changeset 31698:9b3577796291

cmdutil: add a "changeset.obsolete" label in changeset_printer Until now there were no label to highlight obsolete changesets in log output, only evolution troubles (unstable, bumped, divergent) are supported. We add a "changeset.obsolete" label on changeset entries produced by changeset_printer so that obsolete changesets can be highlighted in log output. This is useful because, unless using a graph log where obsolete changesets have a 'x' marker, there's no way to identify obsolete changesets. And even in graph mode, when working directory's parent is obsolete, we get a '@' marker and we do not see it as obsolete.
author Denis Laxalde <denis@laxalde.org>
date Sat, 25 Mar 2017 09:39:07 +0100
parents 992882cef7e1
children 568c4e7437b2
files mercurial/cmdutil.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Tue Mar 28 14:40:13 2017 -0700
+++ b/mercurial/cmdutil.py	Sat Mar 25 09:39:07 2017 +0100
@@ -1155,6 +1155,8 @@
 
 def _changesetlabels(ctx):
     labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
+    if ctx.obsolete():
+        labels.append('changeset.obsolete')
     if ctx.troubled():
         labels.append('changeset.troubled')
         for trouble in ctx.troubles():