# HG changeset patch # User Paul Boddie # Date 1335725856 -7200 # Node ID a6e6bafe0e00b19b969f37bd33a81fe5ac68c2b7 # Parent 80c4c01d4c7bb0fc3d94877dc98d0689055e9fe6 Updated the patch to support and test graph output using the raw style. diff -r 80c4c01d4c7b -r a6e6bafe0e00 patches/patch-hgweb-graph-data.diff --- a/patches/patch-hgweb-graph-data.diff Sat Apr 28 01:35:38 2012 +0200 +++ b/patches/patch-hgweb-graph-data.diff Sun Apr 29 20:57:36 2012 +0200 @@ -1,6 +1,6 @@ diff -r 55982f62651f mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Apr 18 01:20:16 2012 +0300 -+++ b/mercurial/hgweb/webcommands.py Sat Apr 28 01:32:46 2012 +0200 ++++ b/mercurial/hgweb/webcommands.py Sun Apr 29 20:56:26 2012 +0200 @@ -785,6 +785,8 @@ tree = list(graphmod.colored(dag, web.repo)) canvasheight = (len(tree) + 1) * bg_height - 27 @@ -10,7 +10,7 @@ for (id, type, ctx, vtx, edges) in tree: if type != graphmod.CHANGESET: continue -@@ -795,13 +797,37 @@ +@@ -795,13 +797,38 @@ user = cgi.escape(templatefilters.person(ctx.user())) branch = ctx.branch() branch = branch, web.repo.branchtags().get(branch) == ctx.node() @@ -30,12 +30,13 @@ + desc=desc, + user=user, + age=age, -+ branchname=branch[0], -+ branchtip=branch[1], + bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()), + branches=webutil.nodebranchdict(web.repo, ctx), + inbranch=webutil.nodeinbranch(web.repo, ctx), -+ tags=webutil.nodetagsdict(web.repo, ctx.node()))) ++ tags=webutil.nodetagsdict(web.repo, ctx.node()), ++ # convenience values for the canvas graph ++ branchname=branch[0], ++ branchtip=branch[1])) + + cols = max(cols, max([edge[0] for edge in edges] or [0]), + max([edge[1] for edge in edges] or [0])) @@ -51,9 +52,48 @@ def _getdoc(e): doc = e[0].__doc__ +diff -r 55982f62651f mercurial/templates/raw/graph.tmpl +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/mercurial/templates/raw/graph.tmpl Sun Apr 29 20:56:26 2012 +0200 +@@ -0,0 +1,6 @@ ++{header} ++# HG graph ++# Node ID {node} ++# Rows shown {rows} ++ ++{jsdata%graphnode} +diff -r 55982f62651f mercurial/templates/raw/graphedge.tmpl +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/mercurial/templates/raw/graphedge.tmpl Sun Apr 29 20:56:26 2012 +0200 +@@ -0,0 +1,1 @@ ++edge: ({col}, {row}) -> ({nextcol}, {nextrow}) (color {color}) +diff -r 55982f62651f mercurial/templates/raw/graphnode.tmpl +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/mercurial/templates/raw/graphnode.tmpl Sun Apr 29 20:56:26 2012 +0200 +@@ -0,0 +1,7 @@ ++changeset: {node} ++user: {user} ++date: {age} ++summary: {desc} ++{branches%branchname}{tags%tagname}{bookmarks%bookmarkname} ++node: ({col}, {row}) (color {color}) ++{edges%graphedge} +diff -r 55982f62651f mercurial/templates/raw/map +--- a/mercurial/templates/raw/map Wed Apr 18 01:20:16 2012 +0300 ++++ b/mercurial/templates/raw/map Sun Apr 29 20:56:26 2012 +0200 +@@ -28,3 +28,9 @@ + bookmarkentry = '{bookmark} {node}\n' + branches = '{entries%branchentry}' + branchentry = '{branch} {node} {status}\n' ++graph = graph.tmpl ++graphnode = graphnode.tmpl ++graphedge = graphedge.tmpl ++bookmarkname = 'bookmark: {name}\n' ++branchname = 'branch: {name}\n' ++tagname = 'tag: {name}\n' diff -r 55982f62651f mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js Wed Apr 18 01:20:16 2012 +0300 -+++ b/mercurial/templates/static/mercurial.js Sat Apr 28 01:32:46 2012 +0200 ++++ b/mercurial/templates/static/mercurial.js Sun Apr 29 20:56:26 2012 +0200 @@ -108,21 +108,22 @@ this.bg[1] += this.bg_height; @@ -124,7 +164,7 @@ diff -r 55982f62651f tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Wed Apr 18 01:20:16 2012 +0300 -+++ b/tests/test-hgweb-commands.t Sat Apr 28 01:32:46 2012 +0200 ++++ b/tests/test-hgweb-commands.t Sun Apr 29 20:56:26 2012 +0200 @@ -957,7 +957,7 @@