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
 
@@ -577,39 +577,40 @@ def make_map(config):
 
                 controller='pullrequests',
 
                 action='comment', conditions=dict(function=check_repo,
 
                                                method=["POST"]))
 

	
 
    rmap.connect('pullrequest_comment_delete',
 
                 '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete',
 
                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',
 
                conditions=dict(function=check_repo))
 

	
 
    rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}',
 
                controller='files', revision='tip', f_path='',
 
                conditions=dict(function=check_repo))
 

	
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -30,28 +30,47 @@ from pylons import request, url, session
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 

	
 
import rhodecode.lib.helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
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
 

	
 
    def _graph(self, repo, revs_int, repo_size, size, p):
 
        """
 
        Generates a DAG graph for repo
 

	
 
        :param repo:
 
        :param revs_int:
 
@@ -131,12 +150,23 @@ class ChangelogController(BaseRepoContro
 
            _revs = [x.revision for x in c.pagination]
 
        self._graph(c.rhodecode_repo, _revs, c.total_cs, c.size, p)
 

	
 
        return render('changelog/changelog.html')
 

	
 
    @LoginRequired()
 
    @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
 
@@ -46,24 +46,25 @@ from rhodecode.model.db import Statistic
 
from rhodecode.lib.utils import jsonify
 
from rhodecode.lib.utils2 import safe_unicode, safe_str
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator,\
 
    NotAnonymous
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.lib.vcs.backends.base import EmptyChangeset
 
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])]
 

	
 

	
 
class SummaryController(BaseRepoController):
 

	
 
    def __before__(self):
 
        super(SummaryController, self).__before__()
 
@@ -127,33 +128,25 @@ class SummaryController(BaseRepoControll
 
        key = repo_name + '_README'
 
        inv = CacheInvalidation.invalidate(key)
 
        if inv is not None:
 
            region_invalidate(_get_readme_from_cache, None, key)
 
            CacheInvalidation.set_valid(inv.cache_key)
 
        return _get_readme_from_cache(key)
 

	
 
    @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)
 
            password = '@'
 

	
 
        parsed_url = urlparse(url.current(qualified=True))
 

	
 
        default_clone_uri = '{scheme}://{user}{pass}{netloc}{path}'
 

	
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -12,25 +12,24 @@
 
#context-bar a.fork { background-image: url("../images/icons/arrow_divide.png"); }
 
#context-bar a.summary { background-image: url("../images/icons/clipboard_16.png"); }
 
#context-bar a.changelogs { background-image: url("../images/icons/time.png"); }
 
#context-bar a.files { background-image: url("../images/icons/file.png"); }
 
#context-bar a.switch-to { background-image: url("../images/icons/arrow_switch.png"); }
 
#context-bar a.options { background-image: url("../images/icons/table_gear.png"); }
 
#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"); }
 
#context-bar a.users { background-image: url("../images/icons/user_edit.png"); }
 
#context-bar a.groups { background-image: url("../images/icons/group_edit.png"); }
 
#context-bar a.permissions { background-image: url("../images/icons/key.png"); }
 
#context-bar a.ldap { background-image: url("../images/icons/server_key.png"); }
 
#context-bar a.defaults { background-image: url("../images/icons/wrench.png"); }
 
#context-bar a.settings { background-image: url("../images/icons/cog_edit.png"); }
rhodecode/public/css/style.css
Show inline comments
 
@@ -535,28 +535,24 @@ div:hover > a.permalink {
 
#header #header-inner #quick li ul li a.pull_request, #header #header-inner #quick li ul li a.pull_request:hover {
 
    background-image: url("../images/icons/arrow_join.png") ;
 
}
 

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

	
 
#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");
 
}
 

	
 
#header #header-inner #quick li ul li a.tags,
 
#header #header-inner #quick li ul li a.tags:hover {
 
    background: #FFF url("../images/icons/tag_blue.png") no-repeat 4px 9px;
 
    width: 167px;
 
@@ -2752,30 +2748,24 @@ h3.files_location {
 

	
 
.right .parent {
 
    color: #666666;
 
    clear: both;
 
}
 
.right .logtags {
 
    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;
 
    color: #336699;
 
    white-space: nowrap;
 
    -webkit-border-radius: 4px;
 
    border-radius: 4px;
 
    border: 1px solid #d9e8f8;
 
    line-height: 1.5em;
rhodecode/templates/base/base.html
Show inline comments
 
@@ -119,25 +119,24 @@
 
            <li><a href="#">${_('loading...')}</a></li>
 
          </ul>
 
        </li>
 
        <li ${is_current('options')}>
 
          <a href="#" class="dropdown options"></span>${_('Options')}</a>
 
          <ul>
 
             %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:
 
                  <li>${h.link_to(_('Lock'), h.url('toggle_locking',repo_name=c.repo_name),class_='locking_add')}</li>
 
                %endif
 
              %endif
 
              ## TODO: this check feels wrong, it would be better to have a check for permissions
 
              ## also it feels like a job for the controller
 
              %if c.rhodecode_user.username != 'default':
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
 
@@ -252,25 +252,25 @@ ${self.context_bar('summary')}
 
<div class="box">
 
    <div class="title">
 
        <div class="breadcrumbs">
 
        %if c.repo_changesets:
 
            ${h.link_to(_('Latest changes'),h.url('changelog_home',repo_name=c.repo_name))}
 
        %else:
 
            ${_('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">
 
<div class="box" style="background-color: #FAFAFA">
 
    <div class="title" title="${_("Readme file at revision '%s'" % c.rhodecode_db_repo.landing_rev)}">
 
        <div class="breadcrumbs">
 
            <a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a>
 
            <a class="permalink" href="#readme" title="${_('Permalink to this readme')}">&para;</a>
 
        </div>
rhodecode/tests/functional/test_shortlog.py
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)