cmdutil: add support for evolution "troubles" display in changeset_printer
authorDenis Laxalde <denis.laxalde@logilab.fr>
Mon, 10 Oct 2016 12:06:58 +0200
changeset 30695 f05ede08dcf7
parent 30694 5289fd78017a
child 30696 667d9c93c412
cmdutil: add support for evolution "troubles" display in changeset_printer Add a "trouble" line in changeset header along with a couple of labels on "log.changeset" line to indicate whether a changeset is troubled or not and which kind trouble occurs.
mercurial/cmdutil.py
tests/test-commit-amend.t
--- a/mercurial/cmdutil.py	Tue Jan 03 10:56:41 2017 +0100
+++ b/mercurial/cmdutil.py	Mon Oct 10 12:06:58 2016 +0200
@@ -1144,6 +1144,10 @@
 
 def _changesetlabels(ctx):
     labels = ['log.changeset', 'changeset.%s' % ctx.phasestr()]
+    if ctx.troubled():
+        labels.append('changeset.troubled')
+        for trouble in ctx.troubles():
+            labels.append('trouble.%s' % trouble)
     return ' '.join(labels)
 
 class changeset_printer(object):
@@ -1252,6 +1256,10 @@
         self.ui.write(_("date:        %s\n") % date,
                       label='log.date')
 
+        if ctx.troubled():
+            self.ui.write(_("trouble:     %s\n") % ', '.join(ctx.troubles()),
+                          label='ui.note log.trouble')
+
         if self.ui.debugflag:
             files = ctx.p1().status(ctx)[:3]
             for key, value in zip([# i18n: column positioning for "hg log"
--- a/tests/test-commit-amend.t	Tue Jan 03 10:56:41 2017 +0100
+++ b/tests/test-commit-amend.t	Mon Oct 10 12:06:58 2016 +0200
@@ -614,6 +614,7 @@
   parent:      11:3334b7925910
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
+  trouble:     unstable
   summary:     babar