evolve: move return statement at the right level
authorLaurent Charignon <lcharignon@fb.com>
Wed, 13 May 2015 09:43:36 -0700
changeset 1349 70681abf79d1
parent 1348 14b537042245
child 1350 d46a967f257e
evolve: move return statement at the right level When no trouble was found with the --rev option, the code of the evolve function would continue running and would solve unwanted troubles. This patch makes sure it does not happen.
hgext/evolve.py
tests/test-evolve.t
--- a/hgext/evolve.py	Wed May 27 14:00:01 2015 -0700
+++ b/hgext/evolve.py	Wed May 13 09:43:36 2015 -0700
@@ -1314,7 +1314,7 @@
                 seen += 1
             progresscb()
             _cleanup(ui, repo, startnode, showprogress)
-            return
+        return
     nexttrouble = _picknexttroubled(ui, repo, anyopt or allopt)
     # No trouble to resolve
     if not nexttrouble:
--- a/tests/test-evolve.t	Wed May 27 14:00:01 2015 -0700
+++ b/tests/test-evolve.t	Wed May 13 09:43:36 2015 -0700
@@ -1001,6 +1001,11 @@
   |
   o  0	: a0 - test
   
+
+Evolving an empty revset should do nothing
+  $ hg evolve --rev "16 and 15"
+  No troubled changes in the specified revset (no-eol)
+
   $ hg evolve --rev "14::"
   move:[15] add gg
   atop:[18] a3