[PATCH 2 of 3 evolve-ext] evolve: use better error message when no trouble found with --rev

Laurent Charignon lcharignon at fb.com
Thu Jun 4 17:07:46 CDT 2015


# HG changeset patch
# User Laurent Charignon <lcharignon at fb.com>
# Date 1433455392 25200
#      Thu Jun 04 15:03:12 2015 -0700
# Node ID c56ec61b8dcdf856e6c693046e2ef2ded2142b47
# Parent  28f278575b4ce96477f34b1b40f7a80f31084039
evolve: use better error message when no trouble found with --rev

When no trouble was found with --rev we were lacking information about what to
do. This patch reuses the error message used for hg evolve with no argument to
inform the user of what to do (use --all or --any if the troubles are not in
the specified revs).

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1375,7 +1375,7 @@
         troubled = repo.revs('troubled()')
         _revs = repo.revs(revopt) & troubled if revopt else troubled
         if not _revs:
-            ui.write_err("No troubled changes in the specified revisions\n")
+            _handlenotrouble(ui, repo, startnode, dryrunopt)
         else:
             # For the progress bar to show
             count = len(_revs)
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -1017,7 +1017,8 @@
 
 Evolving an empty revset should do nothing
   $ hg evolve --rev "16 and 15"
-  No troubled changes in the specified revisions
+  nothing to evolve here
+  (2 troubled changesets, do you want --any ?)
 
   $ hg evolve --rev "14::"
   move:[15] add gg


More information about the Mercurial-devel mailing list