[Updated] D11826: errors: use detailed exit code for non-integer number of diff context lines

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Tue Nov 30 15:14:06 UTC 2021


Closed by commit rHG67064c238ae7: errors: use detailed exit code for non-integer number of diff context lines (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11826?vs=31198&id=31213

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11826/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11826

AFFECTED FILES
  mercurial/mdiff.py
  tests/test-diff-unified.t

CHANGE DETAILS

diff --git a/tests/test-diff-unified.t b/tests/test-diff-unified.t
--- a/tests/test-diff-unified.t
+++ b/tests/test-diff-unified.t
@@ -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
 
diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py
--- a/mercurial/mdiff.py
+++ b/mercurial/mdiff.py
@@ -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)
             )



To: martinvonz, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211130/625ac2f2/attachment-0002.html>


More information about the Mercurial-patches mailing list