changeset 44560:40f4a75938ba

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
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Dec 2019 15:14:57 -0800
parents ea40fea992e0
children 368f85c5dfc0
files hgext/fix.py tests/test-fix-topology.t
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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