Changeset - 303878dc3dac
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-11-29 19:24:44
marcin@python-works.com
fix shortlog status generation, just fetch for page, not whole set !
1 file changed with 4 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/shortlog.py
Show inline comments
 
@@ -65,41 +65,43 @@ class ShortlogController(BaseRepoControl
 

	
 
    def index(self, repo_name, revision=None, f_path=None):
 
        p = safe_int(request.params.get('page', 1), 1)
 
        size = safe_int(request.params.get('size', 20), 20)
 
        collection = c.rhodecode_repo
 
        c.file_history = f_path
 

	
 
        def url_generator(**kw):
 
            if f_path:
 
                return url('shortlog_file_home', repo_name=repo_name,
 
                           revision=revision, f_path=f_path, size=size, **kw)
 
            return url('shortlog_home', repo_name=repo_name, size=size, **kw)
 

	
 
        if f_path:
 
            log.debug('generating shortlog for path %s' % f_path)
 
            # get the history for the file !
 
            tip_cs = c.rhodecode_repo.get_changeset()
 
            try:
 
                collection = tip_cs.get_file_history(f_path)
 
            except (NodeDoesNotExistError, ChangesetError):
 
                #this node is not present at tip !
 
                try:
 
                    cs = self.__get_cs_or_redirect(revision, repo_name)
 
                    collection = cs.get_file_history(f_path)
 
                except RepositoryError, e:
 
                    h.flash(str(e), category='warning')
 
                    redirect(h.url('shortlog_home', repo_name=repo_name))
 
            collection = list(reversed(collection))
 

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

	
 
        if not c.repo_changesets:
 
            h.flash(_('There are no changesets yet'), category='warning')
 
            return redirect(url('summary_home', repo_name=repo_name))
 

	
 
        c.shortlog_data = render('shortlog/shortlog_data.html')
 
        if request.environ.get('HTTP_X_PARTIAL_XHR'):
 
            return c.shortlog_data
 
        r = render('shortlog/shortlog.html')
 
        return r
0 comments (0 inline, 0 general)