fix: disallow `hg fix --all --working-dir`
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 13 Dec 2019 15:14:57 -0800
changeset 44560 40f4a75938ba
parent 44558 ea40fea992e0
child 44561 368f85c5dfc0
fix: disallow `hg fix --all --working-dir` `--all` implies `--working-dir`, so it's probably a mistake if the user uses both. Differential Revision: https://phab.mercurial-scm.org/D8284
hgext/fix.py
tests/test-fix-topology.t
--- a/hgext/fix.py	Thu Mar 12 16:25:22 2020 -0700
+++ b/hgext/fix.py	Fri Dec 13 15:14:57 2019 -0800
@@ -250,6 +250,7 @@
     """
     opts = pycompat.byteskwargs(opts)
     cmdutil.check_at_most_one_arg(opts, b'all', b'rev')
+    cmdutil.check_incompatible_arguments(opts, b'working_dir', [b'all'])
     if opts[b'all']:
         opts[b'rev'] = [b'not public() and not obsolete()']
         opts[b'working_dir'] = True
--- a/tests/test-fix-topology.t	Thu Mar 12 16:25:22 2020 -0700
+++ b/tests/test-fix-topology.t	Fri Dec 13 15:14:57 2019 -0800
@@ -271,6 +271,9 @@
 
   $ hg init fixall
   $ cd fixall
+  $ hg fix --all --working-dir
+  abort: cannot specify both --working-dir and --all
+  [255]
 
 #if obsstore-on
   $ printf "one\n" > foo.whole