Mercurial > public > mercurial-scm > hg
diff mercurial/hgweb/webcommands.py @ 8842:acd03a6e2426
graphmod/webcommands: use generic DAG walks
Changes graph() to colorededges(), which operates on the new
generic DAG walks and adds color and edge information needed
by the web graph.
This is in preparation of adding DAG walk filters, like the
linear run collapser in the next patch. The idea is to have
a bunch of changelog walkers that return basic data. Then we
can filter this data. Finally we add edge and formatting info
suitable for the output media we want to target (glog, hgweb).
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Fri, 19 Jun 2009 13:44:23 +0200 |
parents | 2bcef677a6c3 |
children | 31177742f54a 5d49fdef6fd0 |
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py Sat May 16 07:12:12 2009 +0200 +++ b/mercurial/hgweb/webcommands.py Fri Jun 19 13:44:23 2009 +0200 @@ -668,10 +668,13 @@ count = len(web.repo) changenav = webutil.revnavgen(rev, revcount, count, web.repo.changectx) - tree = list(graphmod.graph(web.repo, rev, downrev)) + dag = graphmod.revisions(web.repo, rev, downrev) + tree = list(graphmod.colored(dag)) canvasheight = (len(tree) + 1) * bg_height - 27; data = [] - for (ctx, vtx, edges) in tree: + for (id, type, ctx, vtx, edges) in tree: + if type != graphmod.CHANGESET: + continue node = short(ctx.node()) age = templatefilters.age(ctx.date()) desc = templatefilters.firstline(ctx.description())