1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/patch-hgweb-webcommands-SVG.diff Sun Oct 02 16:45:50 2011 +0200
1.3 @@ -0,0 +1,44 @@
1.4 +diff -r b2d4400398f3 mercurial/hgweb/webcommands.py
1.5 +--- a/mercurial/hgweb/webcommands.py Tue Sep 27 18:51:10 2011 +0200
1.6 ++++ b/mercurial/hgweb/webcommands.py Sun Oct 02 16:41:16 2011 +0200
1.7 +@@ -770,6 +770,9 @@
1.8 + tree = list(graphmod.colored(dag))
1.9 + canvasheight = (len(tree) + 1) * bg_height - 27
1.10 + data = []
1.11 ++ svgdata = []
1.12 ++ row = 0
1.13 ++ cols = 0
1.14 + for (id, type, ctx, vtx, edges) in tree:
1.15 + if type != graphmod.CHANGESET:
1.16 + continue
1.17 +@@ -782,11 +785,29 @@
1.18 + branch = branch, web.repo.branchtags().get(branch) == ctx.node()
1.19 + data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(),
1.20 + ctx.bookmarks()))
1.21 ++ svgdata.append(dict(
1.22 ++ node=node,
1.23 ++ col=vtx[0],
1.24 ++ color=(vtx[1] - 1) % 6 + 1,
1.25 ++ edges=[dict(col=edge[0], nextcol=edge[1], color=(edge[2] - 1) % 6 + 1) for edge in edges],
1.26 ++ row=row,
1.27 ++ nextrow=row+1,
1.28 ++ bg_height=bg_height,
1.29 ++ desc=desc,
1.30 ++ user=user,
1.31 ++ age=age,
1.32 ++ branches=webutil.nodebranchdict(web.repo, ctx),
1.33 ++ inbranch=webutil.nodeinbranch(web.repo, ctx),
1.34 ++ tags=webutil.nodetagsdict(web.repo, ctx.node())))
1.35 ++ row += 1
1.36 ++ cols = max(cols, max([edge[0] for edge in edges] or [0]), max([edge[1] for edge in edges] or [0]))
1.37 +
1.38 + return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev,
1.39 + lessvars=lessvars, morevars=morevars, downrev=downrev,
1.40 + canvasheight=canvasheight, jsdata=data, bg_height=bg_height,
1.41 +- node=revnode_hex, changenav=changenav)
1.42 ++ node=revnode_hex, changenav=changenav, svgdata=svgdata,
1.43 ++ rows=row, cols=cols, canvaswidth=(cols+1)*bg_height,
1.44 ++ truecanvasheight=row*bg_height)
1.45 +
1.46 + def _getdoc(e):
1.47 + doc = e[0].__doc__