MercurialWebTheme

Changeset

54:80c4c01d4c7b
2012-04-28 Paul Boddie raw files shortlog changelog graph Removed the superfluous bg_height value from each row in the graph data. Added test suite changes.
patches/patch-hgweb-graph-data.diff (file)
     1.1 --- a/patches/patch-hgweb-graph-data.diff	Sat Apr 28 01:20:56 2012 +0200
     1.2 +++ b/patches/patch-hgweb-graph-data.diff	Sat Apr 28 01:35:38 2012 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  diff -r 55982f62651f mercurial/hgweb/webcommands.py
     1.5  --- a/mercurial/hgweb/webcommands.py	Wed Apr 18 01:20:16 2012 +0300
     1.6 -+++ b/mercurial/hgweb/webcommands.py	Sat Apr 28 01:19:59 2012 +0200
     1.7 ++++ b/mercurial/hgweb/webcommands.py	Sat Apr 28 01:32:46 2012 +0200
     1.8  @@ -785,6 +785,8 @@
     1.9       tree = list(graphmod.colored(dag, web.repo))
    1.10       canvasheight = (len(tree) + 1) * bg_height - 27
    1.11 @@ -10,7 +10,7 @@
    1.12       for (id, type, ctx, vtx, edges) in tree:
    1.13           if type != graphmod.CHANGESET:
    1.14               continue
    1.15 -@@ -795,13 +797,38 @@
    1.16 +@@ -795,13 +797,37 @@
    1.17           user = cgi.escape(templatefilters.person(ctx.user()))
    1.18           branch = ctx.branch()
    1.19           branch = branch, web.repo.branchtags().get(branch) == ctx.node()
    1.20 @@ -27,7 +27,6 @@
    1.21  +                         edges=edgedata,
    1.22  +                         row=row,
    1.23  +                         nextrow=row+1,
    1.24 -+                         bg_height=bg_height,
    1.25  +                         desc=desc,
    1.26  +                         user=user,
    1.27  +                         age=age,
    1.28 @@ -54,7 +53,7 @@
    1.29       doc = e[0].__doc__
    1.30  diff -r 55982f62651f mercurial/templates/static/mercurial.js
    1.31  --- a/mercurial/templates/static/mercurial.js	Wed Apr 18 01:20:16 2012 +0300
    1.32 -+++ b/mercurial/templates/static/mercurial.js	Sat Apr 28 01:19:59 2012 +0200
    1.33 ++++ b/mercurial/templates/static/mercurial.js	Sat Apr 28 01:32:46 2012 +0200
    1.34  @@ -108,21 +108,22 @@
    1.35   			this.bg[1] += this.bg_height;
    1.36   			
    1.37 @@ -123,3 +122,24 @@
    1.38   }
    1.39   
    1.40   
    1.41 +diff -r 55982f62651f tests/test-hgweb-commands.t
    1.42 +--- a/tests/test-hgweb-commands.t	Wed Apr 18 01:20:16 2012 +0300
    1.43 ++++ b/tests/test-hgweb-commands.t	Sat Apr 28 01:32:46 2012 +0200
    1.44 +@@ -957,7 +957,7 @@
    1.45 +   <script>
    1.46 +   <!-- hide script content
    1.47 +   
    1.48 +-  var data = [["ba87b23d29ca", [0, 1], [[0, 0, 1, 3, "FF0000"]], "branch", "test", "1970-01-01", ["unstable", true], ["tip"], ["something"]], ["1d22e65f027e", [0, 1], [[0, 0, 1, 3, ""]], "branch", "test", "1970-01-01", ["stable", true], [], []], ["a4f92ed23982", [0, 1], [[0, 0, 1, 3, ""]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], [], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"], ["anotherthing"]]];
    1.49 ++  var data = [{"node": "ba87b23d29ca", "branches": [{"name": "unstable"}], "desc": "branch", "tags": [{"name": "tip"}], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 1, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "FF0000", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [{"name": "something"}], "branchname": "unstable", "col": 0, "row": 0}, {"node": "1d22e65f027e", "branches": [{"name": "stable"}], "desc": "branch", "tags": [], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 2, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [], "branchname": "stable", "col": 0, "row": 1}, {"node": "a4f92ed23982", "branches": [{"name": "default"}], "desc": "Added tag 1.0 for changeset 2ef0ac749a14", "tags": [], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 3, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [], "branchname": "default", "col": 0, "row": 2}, {"node": "2ef0ac749a14", "branches": [], "desc": "base", "tags": [{"name": "1.0"}], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 4, "edges": [], "user": "test", "branchtip": false, "bookmarks": [{"name": "anotherthing"}], "branchname": "default", "col": 0, "row": 3}];
    1.50 +   var graph = new Graph();
    1.51 +   graph.scale(39);
    1.52 +   
    1.53 +@@ -1214,7 +1214,7 @@
    1.54 + 
    1.55 +   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/graph/' \
    1.56 +   >     | grep '^var data ='
    1.57 +-  var data = [["548001d11f45", [0, 1], [[0, 0, 1, -1, ""]], "\u80fd", "test", "1970-01-01", ["unstable", true], ["tip"], ["something"]], ["ba87b23d29ca", [0, 1], [[0, 0, 1, 3, "FF0000"]], "branch", "test", "1970-01-01", ["unstable", false], [], []], ["1d22e65f027e", [0, 1], [[0, 0, 1, 3, ""]], "branch", "test", "1970-01-01", ["stable", true], [], []], ["a4f92ed23982", [0, 1], [[0, 0, 1, 3, ""]], "Added tag 1.0 for changeset 2ef0ac749a14", "test", "1970-01-01", ["default", true], [], []], ["2ef0ac749a14", [0, 1], [], "base", "test", "1970-01-01", ["default", false], ["1.0"], ["anotherthing"]]];
    1.58 ++  var data = [{"node": "548001d11f45", "branches": [{"name": "unstable"}], "desc": "\u80fd", "tags": [{"name": "tip"}], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 1, "edges": [{"color": 1, "width": -1, "nextcol": 0, "bcolor": "", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [{"name": "something"}], "branchname": "unstable", "col": 0, "row": 0}, {"node": "ba87b23d29ca", "branches": [], "desc": "branch", "tags": [], "color": 1, "age": "1970-01-01", "inbranch": [{"name": "unstable"}], "nextrow": 2, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "FF0000", "col": 0}], "user": "test", "branchtip": false, "bookmarks": [], "branchname": "unstable", "col": 0, "row": 1}, {"node": "1d22e65f027e", "branches": [{"name": "stable"}], "desc": "branch", "tags": [], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 3, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [], "branchname": "stable", "col": 0, "row": 2}, {"node": "a4f92ed23982", "branches": [{"name": "default"}], "desc": "Added tag 1.0 for changeset 2ef0ac749a14", "tags": [], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 4, "edges": [{"color": 1, "width": 3, "nextcol": 0, "bcolor": "", "col": 0}], "user": "test", "branchtip": true, "bookmarks": [], "branchname": "default", "col": 0, "row": 3}, {"node": "2ef0ac749a14", "branches": [], "desc": "base", "tags": [{"name": "1.0"}], "color": 1, "age": "1970-01-01", "inbranch": [], "nextrow": 5, "edges": [], "user": "test", "branchtip": false, "bookmarks": [{"name": "anotherthing"}], "branchname": "default", "col": 0, "row": 4}];
    1.59 + 
    1.60 + capabilities
    1.61 +