Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r 371cff9610cd mercurial/graphmod.py
- --- a/mercurial/graphmod.py Tue Jan 03 17:13:03 2012 -0600
- +++ b/mercurial/graphmod.py Wed Jan 04 15:24:48 2012 +0700
- @@ -16,7 +16,6 @@
- context of the graph returned. Type is a constant specifying the node type.
- Data depends on type.
- """
- -
- from mercurial.node import nullrev
- CHANGESET = 'C'
- @@ -67,7 +66,7 @@
- parents = set([p.rev() for p in ctx.parents() if p.node() in include])
- yield (ctx.rev(), CHANGESET, ctx, sorted(parents))
- -def colored(dag):
- +def colored(dag,repo):
- """annotates a DAG with colored edge information
- For each DAG node this function emits tuples::
- @@ -83,6 +82,11 @@
- seen = []
- colors = {}
- newcolor = 1
- + defaults = {}
- +
- + for (branch, style) in repo.ui.configitems('graph'):
- + defaults[branch] = style.split()
- +
- for (cur, type, data, parents) in dag:
- # Compute seen and next
- @@ -111,10 +115,10 @@
- edges = []
- for ecol, eid in enumerate(seen):
- if eid in next:
- - edges.append((ecol, next.index(eid), colors[eid]))
- + edges.append((ecol, next.index(eid), colors[eid], defaults[repo[eid].branch()] if defaults.has_key(repo[eid].branch()) else None))
- elif eid == cur:
- for p in parents:
- - edges.append((ecol, next.index(p), color))
- + edges.append((ecol, next.index(p), color, defaults[repo[p].branch()] if defaults.has_key(repo[eid].branch()) else None))
- # Yield and move on
- yield (cur, type, data, (col, color), edges)
- diff -r 371cff9610cd mercurial/hgweb/webcommands.py
- --- a/mercurial/hgweb/webcommands.py Tue Jan 03 17:13:03 2012 -0600
- +++ b/mercurial/hgweb/webcommands.py Wed Jan 04 15:24:48 2012 +0700
- @@ -770,7 +770,7 @@
- startrev = uprev
- dag = graphmod.dagwalker(web.repo, range(startrev, downrev - 1, -1))
- - tree = list(graphmod.colored(dag))
- + tree = list(graphmod.colored(dag,web.repo))
- canvasheight = (len(tree) + 1) * bg_height - 27
- data = []
- for (id, type, ctx, vtx, edges) in tree:
- diff -r 371cff9610cd mercurial/templates/static/mercurial.js
- --- a/mercurial/templates/static/mercurial.js Tue Jan 03 17:13:03 2012 -0600
- +++ b/mercurial/templates/static/mercurial.js Wed Jan 04 15:24:48 2012 +0700
- @@ -113,8 +113,13 @@
- 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);
- -
- + if(line[3]){
- + this.ctx.lineWidth = line[3][0] ? line[3][0] : 3;
- + this.edge(x0, y0, x1, y1, color);
- + this.ctx.lineWidth = 1;
- + }else{
- + this.edge(x0, y0, x1, y1, color);
- + }
- }
- // Draw the revision node in the right column
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement