changeset 1487:ee5391999f2d stable

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 10 Aug 2015 00:41:18 -0700
parents e8ebb2441e60
children 3dec62fc266e 2f8a4d496585
files hgext/evolve.py tests/test-prev-next.t
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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