Patchwork [3,of,3] cmdutil: add hidden, obsolete and troubled states to the default template

login
register
mail settings
Submitter Romain DEP.
Date Jan. 6, 2015, 9:47 a.m.
Message ID <16e29a4607250097d988.1420537657@ultas>
Download mbox | patch
Permalink /patch/7329/
State Changes Requested
Headers show

Comments

Romain DEP. - Jan. 6, 2015, 9:47 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1420413104 -3600
#      Mon Jan 05 00:11:44 2015 +0100
# Node ID 16e29a4607250097d98821758e9455453881efb5
# Parent  76d3ce984a461e7c95a83840f8012210b8c9b531
cmdutil: add hidden, obsolete and troubled states to the default template

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -898,9 +898,16 @@ 
         parents = [(p, hexfunc(log.node(p)))
                    for p in self._meaningful_parentrevs(log, rev)]
 
+        def csetlabel(ctx):
+            label  = 'changeset.%s ' % ctx.phasestr()
+            label += 'changeset.%s ' % ctx.hiddenstr()
+            label += 'changeset.%s'  % ctx.obsoletestr()
+            label += ''.join(' changeset.' + t for t in ctx.troubles())
+            return label
+
         # i18n: column positioning for "hg log"
         self.ui.write(_("changeset:   %d:%s\n") % (rev, hexfunc(changenode)),
-                      label='log.changeset changeset.%s' % ctx.phasestr())
+                      label='log.changeset %s' % csetlabel(ctx))
 
         branch = ctx.branch()
         # don't show the default branch name
@@ -921,7 +928,7 @@ 
             self.ui.write(_("phase:       %s\n") % _(ctx.phasestr()),
                           label='log.phase')
         for parent in parents:
-            label = 'log.parent changeset.%s' % self.repo[parent[0]].phasestr()
+            label = 'log.parent %s' % csetlabel(self.repo[parent[0]])
             # i18n: column positioning for "hg log"
             self.ui.write(_("parent:      %d:%s\n") % parent,
                           label=label)