fold: clarify message for empty revision set and abort instead (BC)
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Mon, 30 Jun 2014 10:27:15 -0400
changeset 994 debf44fa91a2
parent 993 8a4a8fe50c26
child 995 0f3a7efd6ee9
fold: clarify message for empty revision set and abort instead (BC) I find it clearer that there are no revisions to fold because none were specified. Otherwise it seems ambiguous: maybe there are no revisions to fold because it's impossible to fold whatever was given? In analogy of other commands that are given no revisions (e.g. strip, graft), this is also now an abort instead of a mere error message, which is a BC.
hgext/evolve.py
tests/test-evolve.t
--- a/hgext/evolve.py	Fri Jul 04 09:29:13 2014 -0400
+++ b/hgext/evolve.py	Mon Jun 30 10:27:15 2014 -0400
@@ -2098,8 +2098,7 @@
     else:
         revs = ()
     if not revs:
-        ui.write_err('no revision to fold\n')
-        return 1
+        raise util.Abort(_('no revisions specified'))
     roots = repo.revs('roots(%ld)', revs)
     if len(roots) > 1:
         raise util.Abort("set has multiple roots")
--- a/tests/test-evolve.t	Fri Jul 04 09:29:13 2014 -0400
+++ b/tests/test-evolve.t	Mon Jun 30 10:27:15 2014 -0400
@@ -614,8 +614,8 @@
 
   $ rm *.orig
   $ hg fold
-  no revision to fold
-  [1]
+  abort: no revisions specified
+  [255]
   $ hg fold 6 --rev 10
   abort: cannot specify both --rev and a target revision
   [255]