next: print some message when on a head with some aspiring children
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 24 Jun 2015 19:42:01 -0700
changeset 1448 3c113c097339
parent 1447 09206bdc2db4
child 1449 9be1cadf7a07
next: print some message when on a head with some aspiring children Being on a head does not necessary means that this is the end of the road. It is likely that some changesets could be evolve as children. We detect this case and provide a hint.
hgext/evolve.py
tests/test-prev-next.t
--- a/hgext/evolve.py	Wed Jun 24 20:23:41 2015 -0700
+++ b/hgext/evolve.py	Wed Jun 24 19:42:01 2015 -0700
@@ -2043,6 +2043,11 @@
         result = 1
     else:
         ui.warn(_('no children\n'))
+        aspchildren = _aspiringchildren(repo, [repo['.'].rev()])
+        if aspchildren:
+            msg = _('(%i unstable changesets to be evolved here, '
+                    'do you want to evolve?)\n')
+            ui.warn(msg % len(aspchildren))
         result = 1
     return result
 
--- a/tests/test-prev-next.t	Wed Jun 24 20:23:41 2015 -0700
+++ b/tests/test-prev-next.t	Wed Jun 24 19:42:01 2015 -0700
@@ -147,6 +147,7 @@
   1 new unstable changesets
   $ hg next
   no children
+  (1 unstable changesets to be evolved here, do you want to evolve?)
   [1]
   $ hg evolve
   move:[2] added c
@@ -178,6 +179,7 @@
   2 new unstable changesets
   $ hg next
   no children
+  (2 unstable changesets to be evolved here, do you want to evolve?)
   [1]
   $ hg evolve
   abort: multiple evolve candidates