[PATCH 2 of 3 evolve-ext] evolve: move return statement at the right level

Laurent Charignon lcharignon at fb.com
Wed May 27 16:23:00 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1431535416 25200
#      Wed May 13 09:43:36 2015 -0700
# Node ID 00df93840fa16456c39f4b89fb616a6a2d2460cf
# Parent  14b537042245f44b61264346114ce5f633907ddc
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.

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -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:
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -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


More information about the Mercurial-devel mailing list