# HG changeset patch # User Martin von Zweigbergk # Date 2021-11-19 23:38:36 # Node ID 67064c238ae730e65a9de591abe0113687870020 # Parent 220506bb213e36facf38a83d0b24d07705064841 errors: use detailed exit code for non-integer number of diff context lines Differential Revision: https://phab.mercurial-scm.org/D11826 diff --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -84,7 +84,7 @@ class diffopts(object): 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) ) 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 @@ invalid --unified $ 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 @@ invalid diff.unified $ hg --config diff.unified=foo diff --nodates abort: diff context lines count must be an integer, not 'foo' - [255] + [10] noprefix config and option