Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/webcommands.py @ 18428:8c10f760ca34
hgweb: walk the graph through the changelog
This is necessary to enforce filtering. The result is a bit buggy (may provide
less changeset than expected, but it will stop crashing on filtered revision
access.
Note that changelog.revs can not represents empty iteration like xrange did. So
we have to explicitly prevent call when there is nothing to do.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 16 Jan 2013 14:22:43 +0100 |
parents | 56ca4443a343 |
children | 010d6d3fcfee |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Fri Jan 11 01:08:00 2013 +0100 +++ b/mercurial/hgweb/webcommands.py Wed Jan 16 14:22:43 2013 +0100 @@ -857,8 +857,11 @@ downrev = max(0, rev - revcount) changenav = webutil.revnav(web.repo).gen(pos, revcount, count) - dag = graphmod.dagwalker(web.repo, range(start, end)[::-1]) - tree = list(graphmod.colored(dag, web.repo)) + tree = [] + if start < end: + revs = list(web.repo.changelog.revs(end - 1, start)) + dag = graphmod.dagwalker(web.repo, revs) + tree = list(graphmod.colored(dag, web.repo)) def getcolumns(tree): cols = 0