Changeset - 41a695e604ba
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-03-01 14:14:10
marcin@python-works.com
small fixes, and optimization for changelog graph
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -71,12 +71,12 @@ class ChangelogController(BaseRepoContro
 
        c.pagination = RepoPage(c.rhodecode_repo, page=p, item_count=c.total_cs,
 
                            items_per_page=c.size, branch_name=branch_name)
 

	
 
        self._graph(c.rhodecode_repo, c.size, p)
 
        self._graph(c.rhodecode_repo, c.total_cs, c.size, p)
 

	
 
        return render('changelog/changelog.html')
 

	
 

	
 
    def _graph(self, repo, size, p):
 
    def _graph(self, repo, repo_size, size, p):
 
        """
 
        Generates a DAG graph for mercurial
 
        
 
@@ -88,7 +88,7 @@ class ChangelogController(BaseRepoContro
 
            c.jsdata = json.dumps([])
 
            return
 

	
 
        revcount = min(repo.size, size)
 
        revcount = min(repo_size, size)
 
        offset = 1 if p == 1 else  ((p - 1) * revcount + 1)
 
        rev_start = repo.revisions.index(repo.revisions[(-1 * offset)])
 
        rev_end = max(0, rev_start - revcount)
0 comments (0 inline, 0 general)