diff mercurial/dispatch.py @ 45933:ac565222b9f8

errors: raise InputError on bad top-level flags Differential Revision: https://phab.mercurial-scm.org/D9388
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 23 Nov 2020 10:39:51 -0800
parents be25b66f86ab
children 1441f4d57083
line wrap: on
line diff
--- a/mercurial/dispatch.py	Mon Nov 23 23:08:58 2020 -0800
+++ b/mercurial/dispatch.py	Mon Nov 23 10:39:51 2020 -0800
@@ -1058,18 +1058,20 @@
         req.canonical_command = cmd
 
         if options[b"config"] != req.earlyoptions[b"config"]:
-            raise error.Abort(_(b"option --config may not be abbreviated"))
+            raise error.InputError(_(b"option --config may not be abbreviated"))
         if options[b"cwd"] != req.earlyoptions[b"cwd"]:
-            raise error.Abort(_(b"option --cwd may not be abbreviated"))
+            raise error.InputError(_(b"option --cwd may not be abbreviated"))
         if options[b"repository"] != req.earlyoptions[b"repository"]:
-            raise error.Abort(
+            raise error.InputError(
                 _(
                     b"option -R has to be separated from other options (e.g. not "
                     b"-qR) and --repository may only be abbreviated as --repo"
                 )
             )
         if options[b"debugger"] != req.earlyoptions[b"debugger"]:
-            raise error.Abort(_(b"option --debugger may not be abbreviated"))
+            raise error.InputError(
+                _(b"option --debugger may not be abbreviated")
+            )
         # don't validate --profile/--traceback, which can be enabled from now
 
         if options[b"encoding"]: