[PATCH 04 of 23 Series-D] hgweb: walk the graph through the changelog
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Thu Jan 10 18:23:49 CST 2013
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1357854142 -3600
# Node ID 850eaea6a6e3a137b1df2b59ae1c9714e8d5999f
# Parent 98f9b2c7ca0e28e657fd93d298d24ef3ad8810c2
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.
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -852,11 +852,12 @@ def graph(web, req, tmpl):
downrev = max(0, rev - revcount)
changenav = webutil.revnavgen(pos, revcount, count, web.repo.changectx)
tree = []
if start < end:
- dag = graphmod.dagwalker(web.repo, range(start, end)[::-1])
+ 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
for (id, type, ctx, vtx, edges) in tree:
More information about the Mercurial-devel
mailing list