# HG changeset patch
# User Simon Heimberg <[email protected]>
# Date 1383670549 -3600
# Node ID b74cc1842025ad42fab3f45cbccb0dca432f733c
# Parent 4f552e6b42f86264d9a47030e1ac17caf2d00390
graph: graph can show a line to obsolescence parents
diff -r 4f552e6b42f8 -r b74cc1842025 tortoisehg/hgqt/graph.py
--- a/tortoisehg/hgqt/graph.py Sam Nov 02 15:32:17 2013 +0900
+++ b/tortoisehg/hgqt/graph.py Die Nov 05 17:55:49 2013 +0100
@@ -30,6 +30,8 @@
from mercurial import repoview
+from tortoiseh.util import obsoleteutil
+
LINE_TYPE_PARENT = 0
LINE_TYPE_GRAFT = 1
@@ -132,12 +134,16 @@
# Add parents to next_revs.
parents = [(p.rev(), LINE_TYPE_PARENT) for p in getparents(ctx)
if not hidden(p.rev())]
- if showgraftsource and 'source' in ctx.extra():
- src_rev_str = ctx.extra()['source']
- if src_rev_str in repo:
+ if showgraftsource:
+ src_rev_str = ctx.extra().get('source')
+ if src_rev_str is not None and src_rev_str in repo:
src_rev = repo[src_rev_str].rev()
if stop_rev <= src_rev < curr_rev and not hidden(src_rev):
parents.append((src_rev, LINE_TYPE_GRAFT))
+ for octx in obsoleteutil.first_known_precursors(ctx):
+ src_rev = octx.rev()
+ if stop_rev <= src_rev < curr_rev and not hidden(src_rev):
+ parents.append((src_rev, LINE_TYPE_GRAFT))
parents_to_add = []
links_to_add = []
children_to_add = []
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Tortoisehg-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop