Simon Heimberg
2013-11-19 00:35:51 UTC
# HG changeset patch
# User Simon Heimberg <***@besonet.ch>
# Date 1383675098 -3600
# Node ID af575fc2cc609800e5e8ba5df45d2e91a04cecc5
# Parent b74cc1842025ad42fab3f45cbccb0dca432f733c
graph: own style for line to obsolescence parents
diff -r b74cc1842025 -r af575fc2cc60 tortoisehg/hgqt/graph.py
--- a/tortoisehg/hgqt/graph.py Die Nov 05 17:55:49 2013 +0100
+++ b/tortoisehg/hgqt/graph.py Die Nov 05 19:11:38 2013 +0100
@@ -34,6 +34,7 @@
LINE_TYPE_PARENT = 0
LINE_TYPE_GRAFT = 1
+LINE_TYPE_OBSOLETE = 2
def revision_grapher(repo, **opts):
"""incremental revision grapher
@@ -143,7 +144,7 @@
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.append((src_rev, LINE_TYPE_OBSOLETE))
parents_to_add = []
links_to_add = []
children_to_add = []
diff -r b74cc1842025 -r af575fc2cc60 tortoisehg/hgqt/repomodel.py
--- a/tortoisehg/hgqt/repomodel.py Die Nov 05 17:55:49 2013 +0100
+++ b/tortoisehg/hgqt/repomodel.py Die Nov 05 19:11:38 2013 +0100
@@ -23,7 +23,7 @@
from tortoisehg.util import hglib
from tortoisehg.hgqt.graph import Graph
from tortoisehg.hgqt.graph import revision_grapher
-from tortoisehg.hgqt.graph import LINE_TYPE_GRAFT
+from tortoisehg.hgqt.graph import LINE_TYPE_GRAFT, LINE_TYPE_OBSOLETE
from tortoisehg.hgqt import qtlib
from tortoisehg.hgqt.i18n import _
@@ -77,10 +77,12 @@
def get_style(line_type, active):
if line_type == LINE_TYPE_GRAFT:
return Qt.DashLine
+ if line_type == LINE_TYPE_OBSOLETE:
+ return Qt.DotLine
return Qt.SolidLine
def get_width(line_type, active):
- if line_type == LINE_TYPE_GRAFT or not active:
+ if line_type >= LINE_TYPE_GRAFT or not active:
return 1
return 2
# User Simon Heimberg <***@besonet.ch>
# Date 1383675098 -3600
# Node ID af575fc2cc609800e5e8ba5df45d2e91a04cecc5
# Parent b74cc1842025ad42fab3f45cbccb0dca432f733c
graph: own style for line to obsolescence parents
diff -r b74cc1842025 -r af575fc2cc60 tortoisehg/hgqt/graph.py
--- a/tortoisehg/hgqt/graph.py Die Nov 05 17:55:49 2013 +0100
+++ b/tortoisehg/hgqt/graph.py Die Nov 05 19:11:38 2013 +0100
@@ -34,6 +34,7 @@
LINE_TYPE_PARENT = 0
LINE_TYPE_GRAFT = 1
+LINE_TYPE_OBSOLETE = 2
def revision_grapher(repo, **opts):
"""incremental revision grapher
@@ -143,7 +144,7 @@
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.append((src_rev, LINE_TYPE_OBSOLETE))
parents_to_add = []
links_to_add = []
children_to_add = []
diff -r b74cc1842025 -r af575fc2cc60 tortoisehg/hgqt/repomodel.py
--- a/tortoisehg/hgqt/repomodel.py Die Nov 05 17:55:49 2013 +0100
+++ b/tortoisehg/hgqt/repomodel.py Die Nov 05 19:11:38 2013 +0100
@@ -23,7 +23,7 @@
from tortoisehg.util import hglib
from tortoisehg.hgqt.graph import Graph
from tortoisehg.hgqt.graph import revision_grapher
-from tortoisehg.hgqt.graph import LINE_TYPE_GRAFT
+from tortoisehg.hgqt.graph import LINE_TYPE_GRAFT, LINE_TYPE_OBSOLETE
from tortoisehg.hgqt import qtlib
from tortoisehg.hgqt.i18n import _
@@ -77,10 +77,12 @@
def get_style(line_type, active):
if line_type == LINE_TYPE_GRAFT:
return Qt.DashLine
+ if line_type == LINE_TYPE_OBSOLETE:
+ return Qt.DotLine
return Qt.SolidLine
def get_width(line_type, active):
- if line_type == LINE_TYPE_GRAFT or not active:
+ if line_type >= LINE_TYPE_GRAFT or not active:
return 1
return 2