next: properly report no children when --evolve is used stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 10 Aug 2015 00:41:18 -0700
branchstable
changeset 1487 ee5391999f2d
parent 1486 e8ebb2441e60
child 1488 3dec62fc266e
child 1489 2f8a4d496585
next: properly report no children when --evolve is used If no aspiring children exist, 'hg next --evolve' should properly issue an error message instead of crashing.
hgext/evolve.py
tests/test-prev-next.t
--- a/hgext/evolve.py	Mon Aug 10 00:24:15 2015 -0700
+++ b/hgext/evolve.py	Mon Aug 10 00:41:18 2015 -0700
@@ -2063,7 +2063,7 @@
         result = 1
     else:
         aspchildren = _aspiringchildren(repo, [repo['.'].rev()])
-        if not opts['evolve']:
+        if not opts['evolve'] or not aspchildren:
             ui.warn(_('no children\n'))
             if aspchildren:
                 msg = _('(%i unstable changesets to be evolved here, '
--- a/tests/test-prev-next.t	Mon Aug 10 00:24:15 2015 -0700
+++ b/tests/test-prev-next.t	Mon Aug 10 00:41:18 2015 -0700
@@ -137,6 +137,9 @@
   $ hg next
   no children
   [1]
+  $ hg next --evolve
+  no children
+  [1]
   $ hg prev
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   [1] added b