changeset 45837:2eb8ad899fa6

errors: raise InputError in fancyopts If a value of wrong type is passed to a command line flag, that's cleary an InputError. Differential Revision: https://phab.mercurial-scm.org/D9308
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 12 Nov 2020 08:29:55 -0800
parents de1f4c431619
children ae00e170f2d1
files mercurial/fancyopts.py tests/test-import.t
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fancyopts.py	Fri Nov 06 17:32:23 2020 +0100
+++ b/mercurial/fancyopts.py	Thu Nov 12 08:29:55 2020 -0800
@@ -380,7 +380,7 @@
         else:
 
             def abort(s):
-                raise error.Abort(
+                raise error.InputError(
                     _(b'invalid value %r for option %s, %s')
                     % (pycompat.maybebytestr(val), opt, s)
                 )
--- a/tests/test-import.t	Fri Nov 06 17:32:23 2020 +0100
+++ b/tests/test-import.t	Thu Nov 12 08:29:55 2020 -0800
@@ -1036,7 +1036,7 @@
   adding a
   $ hg import -p foo
   abort: invalid value 'foo' for option -p, expected int
-  [255]
+  [10]
   $ hg import -p0 - << EOF
   > foobar
   > --- a	Sat Apr 12 22:43:58 2008 -0400