changeset 1399:9ff6d9240f16 stable

template: add a troubles keyword This keyword list all evolution troubles that affect a changeset. Evolution troubles can be "unstable", "divergent" and "bumped".
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 12 Jun 2014 16:10:01 -0700
parents 35492ab5b33b
children ff43167ed0ba
files hgext/evolve.py tests/test-evolve.t
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Tue Jun 03 14:29:24 2014 -0700
+++ b/hgext/evolve.py	Thu Jun 12 16:10:01 2014 -0700
@@ -525,6 +525,13 @@
         return 'unstable'
     return 'stable'
 
+@eh.templatekw('troubles')
+def showtroubles(repo, ctx, **args):
+    """:troubles: List of strings. Evolution troubles affecting the changeset
+    (zero or more of "unstable", "divergent" or "bumped")."""
+    return templatekw.showlist('trouble', ctx.troubles(), plural='troubles',
+                               **args)
+
 #####################################################################
 ### Various trouble warning                                       ###
 #####################################################################
--- a/tests/test-evolve.t	Tue Jun 03 14:29:24 2014 -0700
+++ b/tests/test-evolve.t	Thu Jun 12 16:10:01 2014 -0700
@@ -341,6 +341,27 @@
   $ hg commit --amend -m 'dansk!'
   2 new unstable changesets
 
+(ninja test for the {trouble} template:
+
+  $ hg log -G --template '{rev} {troubles}\n'
+  @  13
+  |
+  | o  11 unstable
+  | |
+  | o  10 unstable
+  | |
+  | x  9
+  |/
+  o  7
+  |
+  o  6
+  |
+  o  0
+  
+
+
+(/ninja)
+
   $ hg evolve --all --traceback
   move:[10] dansk 2!
   atop:[13] dansk!