# HG changeset patch
# User Adrian Buehlmann <[email protected]>
# Date 1259336753 -3600
# Node ID 774bd409298c6d18e9a1f177ae7a8b6dbd4c1789
# Parent 741eceb05c9eb14f79799edc083abee25e156d32
logview: draw a thicker line to second parent
Allows to identify the second parent in the graph.
Always highlight the second parent in the changeset info
for consistency with the highlighting in the graph.
The compact graph mode is not affected.
diff --git a/tortoisehg/hgtk/changeset.py b/tortoisehg/hgtk/changeset.py
--- a/tortoisehg/hgtk/changeset.py
+++ b/tortoisehg/hgtk/changeset.py
@@ -492,7 +492,7 @@ class ChangeSet(gdialog.GDialog):
pctxs = ctx.parents()
parents = []
for pctx in pctxs:
- highlight = len(pctxs) == 2 and pctx == pctxs[pindex]
+ highlight = len(pctxs) == 2 and pctx == pctxs[1]
branch = None
if hasattr(pctx, 'branch') and pctx.branch() !=
ctx.branch():
branch = pctx.branch()
diff --git a/tortoisehg/hgtk/logview/graphcell.py
b/tortoisehg/hgtk/logview/graphcell.py
--- a/tortoisehg/hgtk/logview/graphcell.py
+++ b/tortoisehg/hgtk/logview/graphcell.py
@@ -147,7 +147,9 @@ class CellRendererGraph(gtk.GenericCellR
box_size = self.box_size(widget)
- ctx.set_line_width(box_size / 8)
+ linewidth = box_size / 8
+ merge_linewidth = 2.5 * linewidth
+ ctx.set_line_width(linewidth)
ctx.set_line_cap(cairo.LINE_CAP_ROUND)
# Draw lines into the cell
@@ -155,18 +157,24 @@ class CellRendererGraph(gtk.GenericCellR
style = style_SOLID
if type & 1:
style = style_DASHED
+ if type & 4:
+ ctx.set_line_width(merge_linewidth)
self.render_line (ctx, cell_area, box_size,
bg_area.y, bg_area.height,
start, end, colour, style)
+ ctx.set_line_width(linewidth)
# Draw lines out of the cell
for start, end, colour, type in self.out_lines:
style = style_SOLID
if type & 2:
style = style_DASHED
+ if type & 4:
+ ctx.set_line_width(merge_linewidth)
self.render_line (ctx, cell_area, box_size,
bg_area.y + bg_area.height, bg_area.height,
start, end, colour, style)
+ ctx.set_line_width(linewidth)
# Draw the revision node in the right column
(column, colour, status) = self.node
diff --git a/tortoisehg/hgtk/logview/revgraph.py
b/tortoisehg/hgtk/logview/revgraph.py
--- a/tortoisehg/hgtk/logview/revgraph.py
+++ b/tortoisehg/hgtk/logview/revgraph.py
@@ -129,6 +129,7 @@ def _color_of(repo, rev, nextcolor, pref
type_PLAIN = 0
type_LOOSE_LOW = 1
type_LOOSE_HIGH = 2
+type_MERGE = 4
def revision_grapher(repo, start_rev, stop_rev, branch=None, noheads=False,
branch_color=False):
"""incremental revision grapher
@@ -193,9 +194,12 @@ def revision_grapher(repo, start_rev, st
color = rev_color[rev]
lines.append( (i, next_revs.index(rev), color, type_PLAIN) )
elif rev == curr_rev:
- for parent in parents:
+ for index, parent in enumerate(parents):
color = rev_color[parent]
- lines.append( (i, next_revs.index(parent), color,
type_PLAIN) )
+ type = type_PLAIN
+ if index == 1:
+ type = type | type_MERGE
+ lines.append( (i, next_revs.index(parent), color, type) )
yield (curr_rev, (rev_index, rev_color[curr_rev]), lines, None)
revs = next_revs
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop