[PATCH 5 of 5] [DEMO] indicate how linear run collapsing could be used in hgweb
Peter Arrenbrecht
peter.arrenbrecht at gmail.com
Tue Mar 10 20:30:23 UTC 2009
# HG changeset patch
# User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
# Date 1236716760 -3600
[DEMO] indicate how linear run collapsing could be used in hgweb
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -7,6 +7,7 @@
import os, mimetypes, re, cgi, copy
import webutil
+from itertools import islice
from mercurial import error, archival, templatefilters
from mercurial.node import short, hex, nullid
from mercurial.util import binary, datestr
@@ -640,7 +641,10 @@
count = len(web.repo)
changenav = webutil.revnavgen(rev, revcount, count, web.repo.changectx)
- dag = graphmod.changelogwalk(web.repo, rev, downrev)
+ dag = graphmod.changelogwalk(web.repo, rev, 0)
+ dag = graphmod.collapseruns(dag, 2)
+ dag = islice(dag, revcount)
+
tree = list(graphmod.colorededges(dag))
canvasheight = (len(tree) + 1) * bg_height - 27;
data = []
@@ -655,6 +659,9 @@
branch = ctx.branch()
branch = branch, web.repo.branchtags().get(branch) == ctx.node()
data.append((node, vtx, edges, desc, user, age, branch, ctx.tags()))
+ elif type == graphmod.ELISION:
+ skipped = any
+ data.append(("o", vtx, edges, "%i skipped" % skipped, "", "", "", ""))
return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev,
lessvars=lessvars, morevars=morevars, downrev=downrev,
More information about the Mercurial-devel
mailing list