1 diff -r b2d4400398f3 mercurial/hgweb/webcommands.py 2 --- a/mercurial/hgweb/webcommands.py Tue Sep 27 18:51:10 2011 +0200 3 +++ b/mercurial/hgweb/webcommands.py Sun Oct 02 16:41:16 2011 +0200 4 @@ -770,6 +770,9 @@ 5 tree = list(graphmod.colored(dag)) 6 canvasheight = (len(tree) + 1) * bg_height - 27 7 data = [] 8 + svgdata = [] 9 + row = 0 10 + cols = 0 11 for (id, type, ctx, vtx, edges) in tree: 12 if type != graphmod.CHANGESET: 13 continue 14 @@ -782,11 +785,29 @@ 15 branch = branch, web.repo.branchtags().get(branch) == ctx.node() 16 data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(), 17 ctx.bookmarks())) 18 + svgdata.append(dict( 19 + node=node, 20 + col=vtx[0], 21 + color=(vtx[1] - 1) % 6 + 1, 22 + edges=[dict(col=edge[0], nextcol=edge[1], color=(edge[2] - 1) % 6 + 1) for edge in edges], 23 + row=row, 24 + nextrow=row+1, 25 + bg_height=bg_height, 26 + desc=desc, 27 + user=user, 28 + age=age, 29 + branches=webutil.nodebranchdict(web.repo, ctx), 30 + inbranch=webutil.nodeinbranch(web.repo, ctx), 31 + tags=webutil.nodetagsdict(web.repo, ctx.node()))) 32 + row += 1 33 + cols = max(cols, max([edge[0] for edge in edges] or [0]), max([edge[1] for edge in edges] or [0])) 34 35 return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev, 36 lessvars=lessvars, morevars=morevars, downrev=downrev, 37 canvasheight=canvasheight, jsdata=data, bg_height=bg_height, 38 - node=revnode_hex, changenav=changenav) 39 + node=revnode_hex, changenav=changenav, svgdata=svgdata, 40 + rows=row, cols=cols, canvaswidth=(cols+1)*bg_height, 41 + truecanvasheight=row*bg_height) 42 43 def _getdoc(e): 44 doc = e[0].__doc__