[PATCH] evolution: make troubles appear in default log (issue4686)

liscju piotr.listkiewicz at gmail.com
Fri Sep 2 05:38:46 EDT 2016


# HG changeset patch
# User liscju <piotr.listkiewicz at gmail.com>
# Date 1472809041 -7200
#      Fri Sep 02 11:37:21 2016 +0200
# Node ID 463b164126a0db3f7147787ace34f74deeccc03f
# Parent  f148bfa40489269be2e48046734f81065129847a
evolution: make troubles appear in default log (issue4686)

This patch is request for comment, it does not update failing
test due to new information about troubles, it adds one test
to show how troubles looks like in default log.

First of all do evolution troubles should appear by default
in "default" log only or in templates as well?

In line:

evolutioninfo = [s for s in ['obsolete', ...

its hard coded all possible evolution troubles, are there any
list of them somewhere else?

I check if revision has troubles by doing:

rev in obsolete.getrevs(self.repo, s)

Is there a better way to get all troubles for revision?

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1266,6 +1266,13 @@ class changeset_printer(object):
         self.ui.write(_("changeset:   %d:%s\n") % revnode,
                       label='log.changeset changeset.%s' % ctx.phasestr())
 
+        evolutioninfo = [s for s in ['obsolete', 'unstable', 'suspended',
+                                     'extinct', 'bumped', 'divergent']
+                         if rev in obsolete.getrevs(self.repo, s)]
+
+        if len(evolutioninfo) > 0:
+            self.ui.write(_("evolution:   %s\n") % ', '.join(evolutioninfo))
+
         # branches are shown first before any other names due to backwards
         # compatibility
         branch = ctx.branch()
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -944,6 +944,31 @@ Test bundle overlay onto hidden revision
   |/
   o  0:4b34ecfb0d56 (draft) [ ] A
   
+  $ hg --config 'ui.logtemplate=' log --hidden
+  changeset:   3:b7d587542d40
+  tag:         tip
+  parent:      0:4b34ecfb0d56
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     B+
+  
+  changeset:   2:eb95e9297e18
+  evolution:   obsolete, extinct
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     temporary amend commit for 44526ebb0f98
+  
+  changeset:   1:44526ebb0f98
+  evolution:   obsolete, extinct
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     B
+  
+  changeset:   0:4b34ecfb0d56
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     A
+  
 
   $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
   comparing with ../repo-bundleoverlay


More information about the Mercurial-devel mailing list