comparison 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
comparison
equal deleted inserted replaced
18427:56ca4443a343 18428:8c10f760ca34
855 855
856 uprev = min(max(0, count - 1), rev + revcount) 856 uprev = min(max(0, count - 1), rev + revcount)
857 downrev = max(0, rev - revcount) 857 downrev = max(0, rev - revcount)
858 changenav = webutil.revnav(web.repo).gen(pos, revcount, count) 858 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
859 859
860 dag = graphmod.dagwalker(web.repo, range(start, end)[::-1]) 860 tree = []
861 tree = list(graphmod.colored(dag, web.repo)) 861 if start < end:
862 revs = list(web.repo.changelog.revs(end - 1, start))
863 dag = graphmod.dagwalker(web.repo, revs)
864 tree = list(graphmod.colored(dag, web.repo))
862 865
863 def getcolumns(tree): 866 def getcolumns(tree):
864 cols = 0 867 cols = 0
865 for (id, type, ctx, vtx, edges) in tree: 868 for (id, type, ctx, vtx, edges) in tree:
866 if type != graphmod.CHANGESET: 869 if type != graphmod.CHANGESET: