errors: use detailed exit code for non-integer number of diff context lines
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 19 Nov 2021 15:38:36 -0800
changeset 48365 67064c238ae7
parent 48364 220506bb213e
child 48366 8e855e9984a6
errors: use detailed exit code for non-integer number of diff context lines Differential Revision: https://phab.mercurial-scm.org/D11826
mercurial/mdiff.py
tests/test-diff-unified.t
--- a/mercurial/mdiff.py	Fri Nov 19 09:17:30 2021 -0800
+++ b/mercurial/mdiff.py	Fri Nov 19 15:38:36 2021 -0800
@@ -84,7 +84,7 @@
         try:
             self.context = int(self.context)
         except ValueError:
-            raise error.Abort(
+            raise error.InputError(
                 _(b'diff context lines count must be an integer, not %r')
                 % pycompat.bytestr(self.context)
             )
--- a/tests/test-diff-unified.t	Fri Nov 19 09:17:30 2021 -0800
+++ b/tests/test-diff-unified.t	Fri Nov 19 15:38:36 2021 -0800
@@ -46,7 +46,7 @@
 
   $ hg diff --nodates -U foo
   abort: diff context lines count must be an integer, not 'foo'
-  [255]
+  [10]
 
 
   $ hg diff --nodates -U 2
@@ -87,7 +87,7 @@
 
   $ hg --config diff.unified=foo diff --nodates
   abort: diff context lines count must be an integer, not 'foo'
-  [255]
+  [10]
 
 noprefix config and option