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