Changeset - c7970889c5c0
[Not reviewed]
beta
4 7 1
Marcin Kuzminski - 13 years ago 2013-04-16 00:44:48
marcin@python-works.com
Removed shortlog aka lightweight changelog.
Current version of changelog is fast and condensed.
There's no sense to keep changelog duplicity.
12 files changed with 140 insertions and 288 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/routing.py
Show inline comments
 
@@ -583,27 +583,28 @@ def make_map(config):
 
                controller='pullrequests', action='delete_comment',
 
                conditions=dict(function=check_repo, method=["DELETE"]))
 

	
 
    rmap.connect('summary_home_summary', '/{repo_name:.*?}/summary',
 
                controller='summary', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('shortlog_home', '/{repo_name:.*?}/shortlog',
 
                controller='shortlog', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('branches_home', '/{repo_name:.*?}/branches',
 
                controller='branches', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('tags_home', '/{repo_name:.*?}/tags',
 
                controller='tags', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks',
 
                controller='bookmarks', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('changelog_home', '/{repo_name:.*?}/changelog',
 
                controller='changelog', conditions=dict(function=check_repo))
 

	
 
    rmap.connect('changelog_summary_home', '/{repo_name:.*?}/changelog_summary',
 
                controller='changelog', action='changelog_summary',
 
                conditions=dict(function=check_repo))
 

	
 
    rmap.connect('changelog_file_home', '/{repo_name:.*?}/changelog/{revision}/{f_path:.*}',
 
                controller='changelog', f_path=None,
 
                conditions=dict(function=check_repo))
 

	
 
    rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}',
 
                controller='changelog', action='changelog_details',
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -36,16 +36,35 @@ from rhodecode.lib.base import BaseRepoC
 
from rhodecode.lib.helpers import RepoPage
 
from rhodecode.lib.compat import json
 
from rhodecode.lib.graphmod import _colored, _dagwalker
 
from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError,\
 
    ChangesetError, NodeDoesNotExistError
 
from rhodecode.lib.utils2 import safe_int
 
from webob.exc import HTTPNotFound
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
def _load_changelog_summary():
 
    p = safe_int(request.GET.get('page'), 1)
 
    size = safe_int(request.GET.get('size'), 10)
 

	
 
    def url_generator(**kw):
 
        return url('changelog_summary_home',
 
                   repo_name=c.rhodecode_db_repo.repo_name, size=size, **kw)
 

	
 
    collection = c.rhodecode_repo
 

	
 
    c.repo_changesets = RepoPage(collection, page=p,
 
                                 items_per_page=size,
 
                                 url=url_generator)
 
    page_revisions = [x.raw_id for x in list(c.repo_changesets)]
 
    c.comments = c.rhodecode_db_repo.get_comments(page_revisions)
 
    c.statuses = c.rhodecode_db_repo.statuses(page_revisions)
 

	
 

	
 
class ChangelogController(BaseRepoController):
 

	
 
    def __before__(self):
 
        super(ChangelogController, self).__before__()
 
        c.affected_files_cut_off = 60
 

	
 
@@ -137,6 +156,17 @@ class ChangelogController(BaseRepoContro
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def changelog_details(self, cs):
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            c.cs = c.rhodecode_repo.get_changeset(cs)
 
            return render('changelog/changelog_details.html')
 
        raise HTTPNotFound()
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def changelog_summary(self, repo_name):
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            _load_changelog_summary()
 

	
 
            return render('changelog/changelog_summary_data.html')
 
        raise HTTPNotFound()
rhodecode/controllers/shortlog.py
Show inline comments
 
deleted file
rhodecode/controllers/summary.py
Show inline comments
 
@@ -52,12 +52,13 @@ from rhodecode.lib.vcs.backends.base imp
 
from rhodecode.lib.markup_renderer import MarkupRenderer
 
from rhodecode.lib.celerylib import run_task
 
from rhodecode.lib.celerylib.tasks import get_commits_stats
 
from rhodecode.lib.helpers import RepoPage
 
from rhodecode.lib.compat import json, OrderedDict
 
from rhodecode.lib.vcs.nodes import FileNode
 
from rhodecode.controllers.changelog import _load_changelog_summary
 

	
 
log = logging.getLogger(__name__)
 

	
 
README_FILES = [''.join([x[0][0], x[1][0]]) for x in
 
                    sorted(list(product(ALL_READMES, ALL_EXTS)),
 
                           key=lambda y:y[0][1] + y[1][1])]
 
@@ -133,21 +134,13 @@ class SummaryController(BaseRepoControll
 

	
 
    @LoginRequired()
 
    @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
 
                                   'repository.admin')
 
    def index(self, repo_name):
 
        c.dbrepo = dbrepo = c.rhodecode_db_repo
 

	
 
        def url_generator(**kw):
 
            return url('shortlog_home', repo_name=repo_name, size=10, **kw)
 

	
 
        c.repo_changesets = RepoPage(c.rhodecode_repo, page=1,
 
                                     items_per_page=10, url=url_generator)
 
        page_revisions = [x.raw_id for x in list(c.repo_changesets)]
 
        c.statuses = c.rhodecode_db_repo.statuses(page_revisions)
 

	
 
        _load_changelog_summary()
 
        if self.rhodecode_user.username == 'default':
 
            # for default(anonymous) user we don't need to pass credentials
 
            username = ''
 
            password = ''
 
        else:
 
            username = str(self.rhodecode_user.username)
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -18,13 +18,12 @@
 
#context-bar a.forks { background-image: url("../images/icons/arrow_divide.png"); }
 
#context-bar a.pull-request { background-image: url("../images/icons/arrow_join.png"); }
 
#context-bar a.branches { background-image: url("../images/icons/arrow_branch.png"); }
 
#context-bar a.tags { background-image: url("../images/icons/tag_blue.png"); }
 
#context-bar a.bookmarks { background-image: url("../images/icons/tag_green.png"); }
 
#context-bar a.settings { background-image: url("../images/icons/cog.png"); }
 
#context-bar a.shortlog { background-image: url("../images/icons/time.png"); }
 
#context-bar a.search { background-image: url("../images/icons/search_16.png"); }
 
#context-bar a.admin { background-image: url("../images/icons/cog_edit.png"); }
 

	
 
#context-bar a.journal { background-image: url("../images/icons/book.png"); }
 
#context-bar a.repos { background-image: url("../images/icons/database_edit.png"); }
 
#context-bar a.repos_groups { background-image: url("../images/icons/database_link.png"); }
rhodecode/public/css/style.css
Show inline comments
 
@@ -541,16 +541,12 @@ div:hover > a.permalink {
 
}
 

	
 
#header #header-inner #quick li ul li a.search, #header #header-inner #quick li ul li a.search:hover {
 
    background-image: url("../images/icons/search_16.png");
 
}
 

	
 
#header #header-inner #quick li ul li a.shortlog, #header #header-inner #quick li ul li a.shortlog:hover {
 
    background-image: url("../images/icons/clock_16.png");
 
}
 

	
 
#header #header-inner #quick li ul li a.delete, #header #header-inner #quick li ul li a.delete:hover {
 
    background-image: url("../images/icons/delete.png");
 
}
 

	
 
#header #header-inner #quick li ul li a.branches, #header #header-inner #quick li ul li a.branches:hover {
 
    background-image: url("../images/icons/arrow_branch.png");
 
@@ -2758,18 +2754,12 @@ h3.files_location {
 
    line-height: 2.2em;
 
}
 
.branchtag, .logtags .tagtag, .logtags .booktag {
 
    margin: 0px 2px;
 
}
 

	
 
#shortlog_data .branchtag,
 
#shortlog_data .booktag,
 
#shortlog_data .tagtag {
 
    margin: 0px 2px;
 
}
 

	
 
.branchtag,
 
.tagtag,
 
.booktag,
 
.spantag {
 
    padding: 1px 3px 1px 3px;
 
    font-size: 10px;
rhodecode/templates/base/base.html
Show inline comments
 
@@ -125,13 +125,12 @@
 
             %if h.HasRepoPermissionAll('repository.admin')(c.repo_name):
 
                   <li>${h.link_to(_('Settings'),h.url('edit_repo',repo_name=c.repo_name),class_='settings')}</li>
 
             %endif
 
              %if c.rhodecode_db_repo.fork:
 
               <li>${h.link_to(_('Compare fork'),h.url('compare_url',repo_name=c.rhodecode_db_repo.fork.repo_name,org_ref_type='branch',org_ref='default',other_repo=c.repo_name,other_ref_type='branch',other_ref=request.GET.get('branch') or 'default', merge=1),class_='compare_request')}</li>
 
              %endif
 
              <li>${h.link_to(_('Lightweight changelog'),h.url('shortlog_home',repo_name=c.repo_name),class_='shortlog')}</li>
 
              <li>${h.link_to(_('Search'),h.url('search_repo',repo_name=c.repo_name),class_='search')}</li>
 

	
 
              %if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name) and c.rhodecode_db_repo.enable_locking:
 
                %if c.rhodecode_db_repo.locked[0]:
 
                  <li>${h.link_to(_('Unlock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_del')}</li>
 
                %else:
rhodecode/templates/changelog/changelog_summary_data.html
Show inline comments
 
new file 100644
 
## -*- coding: utf-8 -*-
 
%if c.repo_changesets:
 
<table class="table_disp">
 
    <tr>
 
        <th class="left">${_('Revision')}</th>
 
        <th class="left">${_('Commit message')}</th>
 
        <th class="left">${_('Age')}</th>
 
        <th class="left">${_('Author')}</th>
 
        <th class="left">${_('Refs')}</th>
 
    </tr>
 
%for cnt,cs in enumerate(c.repo_changesets):
 
    <tr class="parity${cnt%2}">
 
        <td>
 
          <div>
 
            <div class="changeset-status-container">
 
              %if c.statuses.get(cs.raw_id):
 
                <div class="changeset-status-ico">
 
                %if c.statuses.get(cs.raw_id)[2]:
 
                  <a class="tooltip" title="${_('Click to open associated pull request #%s' % c.statuses.get(cs.raw_id)[2])}" href="${h.url('pullrequest_show',repo_name=c.statuses.get(cs.raw_id)[3],pull_request_id=c.statuses.get(cs.raw_id)[2])}">
 
                    <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
 
                  </a>
 
                %else:
 
                  <img src="${h.url('/images/icons/flag_status_%s.png' % c.statuses.get(cs.raw_id)[0])}" />
 
                %endif
 
                </div>
 
              %endif
 
            </div>
 
            <pre><a href="${h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id)}">${h.show_id(cs)}</a></pre>
 
         </div>
 
        </td>
 
        <td>
 
            ${h.urlify_commit(h.truncate(cs.message,50),c.repo_name, h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
        </td>
 
        <td><span class="tooltip" title="${h.tooltip(h.fmt_date(cs.date))}">
 
                      ${h.age(cs.date)}</span>
 
        </td>
 
        <td title="${cs.author}">${h.person(cs.author)}</td>
 
        <td>
 
            %if h.is_hg(c.rhodecode_repo):
 
                %for book in cs.bookmarks:
 
                    <div class="booktag" title="${_('Bookmark %s') % book}">
 
                        ${h.link_to(h.shorter(book),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
                    </div>
 
                %endfor
 
            %endif
 
            %for tag in cs.tags:
 
             <div class="tagtag" title="${_('Tag %s') % tag}">
 
                 ${h.link_to(h.shorter(tag),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
 
             </div>
 
            %endfor
 
            %if cs.branch:
 
             <div class="branchtag" title="${_('Branch %s' % cs.branch)}">
 
                 ${h.link_to(h.shorter(cs.branch),h.url('changelog_home',repo_name=c.repo_name,branch=cs.branch))}
 
             </div>
 
            %endif
 
        </td>
 
    </tr>
 
%endfor
 

	
 
</table>
 

	
 
<script type="text/javascript">
 
  YUE.onDOMReady(function(){
 
    YUE.delegate("shortlog_data","click",function(e, matchedEl, container){
 
        ypjax(e.target.href,"shortlog_data",function(){tooltip_activate();});
 
        YUE.preventDefault(e);
 
    },'.pager_link');
 
  });
 
</script>
 

	
 
<div class="pagination-wh pagination-left">
 
${c.repo_changesets.pager('$link_previous ~2~ $link_next')}
 
</div>
 
%else:
 

	
 
%if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
 
<h4>${_('Add or upload files directly via RhodeCode')}</h4>
 
<div style="margin: 20px 30px;">
 
  <div id="add_node_id" class="add_node">
 
      <a class="ui-btn" href="${h.url('files_add_home',repo_name=c.repo_name,revision=0,f_path='')}">${_('Add new file')}</a>
 
  </div>
 
</div>
 
%endif
 

	
 

	
 
<h4>${_('Push new repo')}</h4>
 
<pre>
 
    ${c.rhodecode_repo.alias} clone ${c.clone_repo_url}
 
    ${c.rhodecode_repo.alias} add README # add first file
 
    ${c.rhodecode_repo.alias} commit -m "Initial" # commit with message
 
    ${c.rhodecode_repo.alias} push ${'origin master' if h.is_git(c.rhodecode_repo) else ''} # push changes back
 
</pre>
 

	
 
<h4>${_('Existing repository?')}</h4>
 
<pre>
 
%if h.is_git(c.rhodecode_repo):
 
    git remote add origin ${c.clone_repo_url}
 
    git push -u origin master
 
%else:
 
    hg push ${c.clone_repo_url}
 
%endif
 
</pre>
 
%endif
rhodecode/templates/shortlog/shortlog.html
Show inline comments
 
deleted file
rhodecode/templates/shortlog/shortlog_data.html
Show inline comments
 
deleted file
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -258,13 +258,13 @@ ${self.context_bar('summary')}
 
            ${_('Quick start')}
 
         %endif
 
        </div>
 
    </div>
 
    <div class="table">
 
        <div id="shortlog_data">
 
            <%include file='../shortlog/shortlog_data.html'/>
 
            <%include file='../changelog/changelog_summary_data.html'/>
 
        </div>
 
    </div>
 
</div>
 

	
 
%if c.readme_data:
 
<div id="readme" class="anchor">
rhodecode/tests/functional/test_shortlog.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)