MercurialWebTheme

Change of patches/patch-hgweb-webcommands-SVG.diff

52:84c2b3fdf0b9
patches/patch-hgweb-webcommands-SVG.diff
     1.1 --- a/patches/patch-hgweb-webcommands-SVG.diff	Fri Dec 02 00:26:18 2011 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,52 +0,0 @@
     1.4 -# HG changeset patch
     1.5 -# User Paul Boddie <paul@boddie.org.uk>
     1.6 -# Date 1322607302 -3600
     1.7 -# Node ID 160b604c1b8f8066976e86c63ece2062f075d1b6
     1.8 -# Parent  ad686c818e1c7d5ed0335327321003ba8ea04664
     1.9 -hgweb: Provide SVG-related data to the output of the graph command
    1.10 -
    1.11 -diff -r ad686c818e1c -r 160b604c1b8f mercurial/hgweb/webcommands.py
    1.12 ---- a/mercurial/hgweb/webcommands.py	Fri Nov 25 02:11:12 2011 +0100
    1.13 -+++ b/mercurial/hgweb/webcommands.py	Tue Nov 29 23:55:02 2011 +0100
    1.14 -@@ -772,6 +772,9 @@
    1.15 -     tree = list(graphmod.colored(dag))
    1.16 -     canvasheight = (len(tree) + 1) * bg_height - 27
    1.17 -     data = []
    1.18 -+    svgdata = []
    1.19 -+    row = 0
    1.20 -+    cols = 0
    1.21 -     for (id, type, ctx, vtx, edges) in tree:
    1.22 -         if type != graphmod.CHANGESET:
    1.23 -             continue
    1.24 -@@ -784,11 +787,30 @@
    1.25 -         branch = branch, web.repo.branchtags().get(branch) == ctx.node()
    1.26 -         data.append((node, vtx, edges, desc, user, age, branch, ctx.tags(),
    1.27 -                      ctx.bookmarks()))
    1.28 -+        svgdata.append(dict(
    1.29 -+            node=node,
    1.30 -+            col=vtx[0],
    1.31 -+            color=(vtx[1] - 1) % 6 + 1,
    1.32 -+            edges=[dict(col=edge[0], nextcol=edge[1], color=(edge[2] - 1) % 6 + 1) for edge in edges],
    1.33 -+            row=row,
    1.34 -+            nextrow=row+1,
    1.35 -+            bg_height=bg_height,
    1.36 -+            desc=desc,
    1.37 -+            user=user,
    1.38 -+            age=age,
    1.39 -+            bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()),
    1.40 -+            branches=webutil.nodebranchdict(web.repo, ctx),
    1.41 -+            inbranch=webutil.nodeinbranch(web.repo, ctx),
    1.42 -+            tags=webutil.nodetagsdict(web.repo, ctx.node())))
    1.43 -+        row += 1
    1.44 -+        cols = max(cols, max([edge[0] for edge in edges] or [0]), max([edge[1] for edge in edges] or [0]))
    1.45 - 
    1.46 -     return tmpl('graph', rev=rev, revcount=revcount, uprev=uprev,
    1.47 -                 lessvars=lessvars, morevars=morevars, downrev=downrev,
    1.48 -                 canvasheight=canvasheight, jsdata=data, bg_height=bg_height,
    1.49 --                node=revnode_hex, changenav=changenav)
    1.50 -+                node=revnode_hex, changenav=changenav, svgdata=svgdata,
    1.51 -+                rows=row, cols=cols, canvaswidth=(cols+1)*bg_height,
    1.52 -+                truecanvasheight=row*bg_height)
    1.53 - 
    1.54 - def _getdoc(e):
    1.55 -     doc = e[0].__doc__