Commits

Nozomu Kaneko committed 9b5c2ea

update patches for Mercurial 2.2

Comments (0)

Files changed (4)

graph-color.diff

-# HG changeset patch
-# Parent 40fb7dea3e21f97a3d6c6e5214fa7f7856e496c6
-
-diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
---- a/mercurial/graphmod.py
-+++ b/mercurial/graphmod.py
-@@ -82,33 +82,32 @@
-     """
-     tree = []
-     seen = []
-+    branch_colors = {}
-     colors = {}
-     newcolor = 1
-     maxcol = 0
--    for (cur, type, data, parents) in dag:
-+    for (cur, type, ctx, parents) in dag:
- 
-         # Compute seen and next
-         if cur not in seen:
--            seen.append(cur) # new head
--            colors[cur] = newcolor
-+            # new head
-+            seen.append(cur)
-+
-+        branch = ctx.branch()
-+        if branch not in branch_colors:
-+            # new branch
-+            branch_colors[branch] = newcolor
-             newcolor += 1
- 
-         col = seen.index(cur)
--        color = colors.pop(cur)
-+        colors[cur] = branch_colors[branch]
-+        color = colors[cur]
-         next = seen[:]
- 
-         # Add parents to next
-         addparents = [p for p in parents if p not in next]
-         next[col:col + 1] = addparents
- 
--        # Set colors for the parents
--        for i, p in enumerate(addparents):
--            if not i:
--                colors[p] = color
--            else:
--                colors[p] = newcolor
--                newcolor += 1
--
-         # Add edges to the graph
-         edges = []
-         for ecol, eid in enumerate(seen):
-@@ -116,17 +115,21 @@
-                 edges.append((ecol, next.index(eid), colors[eid]))
-             elif eid == cur:
-                 for p in parents:
--                    edges.append((ecol, next.index(p), colors[p]))
-+                    edges.append((ecol, next.index(p), color))
-+
-+        # Set colors for the parents
-+        for i, p in enumerate(parents):
-+            colors[p] = color
- 
-         # Append and move on
--        tree.append((cur, type, data, (col, color), edges))
-+        tree.append((cur, type, ctx, (col, color), edges))
-         maxcol = max(maxcol, len(seen))
-         seen = next
- 
--    for cur, type, data, (col, color), edges in tree:
-+    for cur, type, ctx, (col, color), edges in tree:
-         edges = [(maxcol - ecol - 1, maxcol - nextcol - 1, ecolor)
-                  for ecol, nextcol, ecolor in edges]
--        yield (cur, type, data, (maxcol - col - 1, color), edges)
-+        yield (cur, type, ctx, (maxcol - col - 1, color), edges)
- 
- def grandparent(cl, lowestrev, roots, head):
-     """Return all ancestors of head in roots which revision is

graph-color2.diff

+# HG changeset patch
+# Parent dd8e8053a035867c04d374ea5c69e7ad34e28121
+diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
+--- a/mercurial/graphmod.py
++++ b/mercurial/graphmod.py
+@@ -150,9 +150,12 @@
+         seen = next
+ 
+     for cur, type, data, (col, color), edges in tree:
++        bconf = getconf(cur)
+         edges = [(maxcol - edge[0] - 1, maxcol - edge[1] - 1) + edge[2:]
+                  for edge in edges]
+-        yield (cur, type, data, (maxcol - col - 1, color), edges)
++        yield (cur, type, data,
++               (maxcol - col - 1, color, bconf.get('color', '')),
++               edges)
+ 
+ def grandparent(cl, lowestrev, roots, head):
+     """Return all ancestors of head in roots which revision is
+diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js
+--- a/mercurial/templates/static/mercurial.js
++++ b/mercurial/templates/static/mercurial.js
+@@ -146,6 +146,9 @@
+ 			
+ 			column = node[0];
+ 			color = node[1];
++			var branchcolor = node[2];
++			if(branchcolor)
++				color = branchcolor;
+ 			
+ 			radius = this.radius;
+ 			x = this.cell[0] + this.box_size * column + this.box_size / 2;
 # Date 1318377579 -32400
 # Branch mq
 # Node ID 1307bc05a903f36981356ced78488579e1502a42
-# Parent 819eea6319f623b8a3992efbcb7818d173f6a0a3
+# Parent a7e54688856174dfa2ecb604825ed1cf2390c713
 customize graph style
 
 diff --git a/mercurial/graphmod.py b/mercurial/graphmod.py
 --- a/mercurial/graphmod.py
 +++ b/mercurial/graphmod.py
-@@ -80,9 +80,11 @@
+@@ -81,9 +81,11 @@
        - A list of tuples indicating the edges between the current node and its
          parents.
      """
      colors = {}
      newcolor = 1
 +    maxcol = 0
-     for (cur, type, data, parents) in dag:
+     config = {}
  
-         # Compute seen and next
-@@ -114,12 +116,18 @@
-                 edges.append((ecol, next.index(eid), colors[eid]))
-             elif eid == cur:
-                 for p in parents:
--                    edges.append((ecol, next.index(p), color))
-+                    edges.append((ecol, next.index(p), colors[p]))
+     for key, val in repo.ui.configitems('graph'):
+@@ -142,10 +144,16 @@
+                         bconf.get('width', -1),
+                         bconf.get('color', '')))
  
 -        # Yield and move on
 -        yield (cur, type, data, (col, color), edges)
          seen = next
  
 +    for cur, type, data, (col, color), edges in tree:
-+        edges = [(maxcol - ecol - 1, maxcol - nextcol - 1, ecolor)
-+                 for ecol, nextcol, ecolor in edges]
++        edges = [(maxcol - edge[0] - 1, maxcol - edge[1] - 1) + edge[2:]
++                 for edge in edges]
 +        yield (cur, type, data, (maxcol - col - 1, color), edges)
 +
  def grandparent(cl, lowestrev, roots, head):
 diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
 --- a/mercurial/hgweb/webcommands.py
 +++ b/mercurial/hgweb/webcommands.py
-@@ -780,12 +780,13 @@
+@@ -833,12 +833,13 @@
          user = cgi.escape(templatefilters.person(ctx.user()))
          branch = ctx.branch()
          branch = branch, web.repo.branchtags().get(branch) == ctx.node()
 diff --git a/mercurial/templates/monoblue/graph.tmpl b/mercurial/templates/monoblue/graph.tmpl
 --- a/mercurial/templates/monoblue/graph.tmpl
 +++ b/mercurial/templates/monoblue/graph.tmpl
-@@ -61,7 +61,7 @@
+@@ -57,7 +57,7 @@
  
      var revlink = '<li style="_STYLE"><span class="desc">';
      revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
  
      graph.vertex = function(x, y, color, parity, cur) \{
  
-@@ -71,7 +71,7 @@
+@@ -67,7 +67,7 @@
          this.ctx.fill();
  
          var bg = '<li class="bg parity' + parity + '"></li>';
          var nstyle = 'padding-left: ' + left + 'px;';
          var item = revlink.replace(/_STYLE/, nstyle);
          item = item.replace(/_PARITY/, 'parity' + parity);
-@@ -82,14 +82,16 @@
+@@ -78,14 +78,16 @@
          item = item.replace(/_DATE/, cur[5]);
  
          var tagspan = '';
  		this.cell_height = this.box_size;
  	}
  	
-@@ -91,7 +92,8 @@
+@@ -110,7 +111,8 @@
  			var cur = data[i];
  			var node = cur[1];
  			var edges = cur[2];
 +			
 +			this.columns = node[0];
  			
+ 			var prevWidth = this.ctx.lineWidth;
  			for (var j in edges) {
+@@ -126,38 +128,32 @@
+ 				if(branchcolor)
+ 					color = branchcolor;
  				
-@@ -100,37 +102,30 @@
- 				end = line[1];
- 				color = line[2];
- 
 -				if (end > this.columns || start > this.columns) {
 -					this.columns += 1;
 -				}
  				x1 = this.cell[0] + this.box_size * end + this.box_size / 2;
  				y1 = this.bg[1] + this.bg_height / 2;
  				
- 				this.edge(x0, y0, x1, y1, color);
+ 				this.edge(x0, y0, x1, y1, color, width);
 -				
 +
 +				if (start > this.columns) {
 +					this.columns = start;
 +				}
++
  			}
+ 			this.ctx.lineWidth = prevWidth;
  			
  			// Draw the revision node in the right column
  			
 diff --git a/mercurial/templates/static/style-monoblue.css b/mercurial/templates/static/style-monoblue.css
 --- a/mercurial/templates/static/style-monoblue.css
 +++ b/mercurial/templates/static/style-monoblue.css
-@@ -234,18 +234,20 @@
+@@ -276,18 +276,20 @@
    background-color: #ffaaff;
    border-color: #ffccff #ff00ee #ff00ee #ffccff;
  }
  span.logtags span.bookmarktag {
    background-color: #afdffa;
    border-color: #ccecff #46ace6 #46ace6 #ccecff;
-@@ -366,6 +368,10 @@
+@@ -408,6 +410,10 @@
      font-weight: bold;
      width: 150px;
    }
  /** end of summary **/
  
  /** chagelog **/
-@@ -419,6 +425,7 @@
+@@ -469,6 +475,7 @@
  }
  p.changeset-age {
    position: relative;
  }
  p.changeset-age span {
    position: absolute;
-@@ -460,8 +467,9 @@
+@@ -510,8 +517,9 @@
  ul#graphnodes {
  	position: absolute;
  	z-index: 10;
  }
  
  ul#nodebgs {
-@@ -472,8 +480,17 @@
+@@ -522,10 +530,19 @@
  	height: 39px;
  }
  
  }
 +
  /** end of canvas **/
+ 
+ div#page-back, div#page-next {
 emailhash.diff
 avatar-templates.diff
 hgwebdir-templates.diff
-graph.diff
 page-nav-graph.diff
 closed-branch-style.diff
 simple-index.diff
 fix-title.diff
 page-nav.diff
 fix-direntry.diff
-graph-curve.diff
-graph-color.diff
 page-path-style.diff
 pagenav.diff
 manifest-style.diff
+graph.diff
+graph-curve.diff
+graph-color2.diff