Mercurial > kallithea
diff rhodecode/controllers/changelog.py @ 1109:41a695e604ba beta
small fixes, and optimization for changelog graph
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 01 Mar 2011 14:14:10 +0100 |
parents | 5cbaeda8ec6f |
children | 1cecc7db3106 |
line wrap: on
line diff
--- a/rhodecode/controllers/changelog.py Tue Mar 01 13:47:47 2011 +0100 +++ b/rhodecode/controllers/changelog.py Tue Mar 01 14:14:10 2011 +0100 @@ -71,12 +71,12 @@ 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 @@ 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)