evolve: prevent using --rev and --any together
authorLaurent Charignon <lcharignon@fb.com>
Tue, 16 Jun 2015 16:58:38 -0700
changeset 1405 eaf82490af76
parent 1404 848a04c078c7
child 1406 5a91ee6a42e6
evolve: prevent using --rev and --any together Before this patch it was possible to use evolve --rev --any and it meant evolve --rev. This patch throws an error when using evolve --rev --any.
hgext/evolve.py
tests/test-evolve.t
--- a/hgext/evolve.py	Tue Jun 16 15:14:37 2015 -0700
+++ b/hgext/evolve.py	Tue Jun 16 16:58:38 2015 -0700
@@ -1439,6 +1439,8 @@
         revs = set([tro])
     elif targetcat in repo['.'].troubles():
         revs = set([repo['.'].rev()])
+    if revopt and anyopt:
+        raise util.Abort('cannot specify both "--rev" and "--any"')
     if not revs:
         msg = "no troubled changes in the specified revisions"
         raise util.Abort(msg)
--- a/tests/test-evolve.t	Tue Jun 16 15:14:37 2015 -0700
+++ b/tests/test-evolve.t	Tue Jun 16 16:58:38 2015 -0700
@@ -1074,6 +1074,9 @@
   o  18:0bb66d4c1968@default(draft) a3
   |
 
+  $ hg evolve --rev 23 --any
+  abort: cannot specify both "--rev" and "--any"
+  [255]
   $ hg evolve --rev 23
   cannot solve instability of c70048fd3350, skipping