[Updated] D9387: errors: raise InputError on early parse error in dispatch
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Mon Dec 14 21:32:19 UTC 2020
martinvonz edited the summary of this revision.
martinvonz retitled this revision from "errors: raise ConfigError on early parse error in dispatch" to "errors: raise InputError on early parse error in dispatch".
martinvonz updated this revision to Diff 24269.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D9387?vs=23645&id=24269
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D9387/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D9387
AFFECTED FILES
mercurial/dispatch.py
tests/test-globalopts.t
CHANGE DETAILS
diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t
--- a/tests/test-globalopts.t
+++ b/tests/test-globalopts.t
@@ -217,19 +217,19 @@
quuxfoo
$ hg --cwd c --config '' tip -q
abort: malformed --config option: '' (use --config section.name=value)
- [255]
+ [10]
$ hg --cwd c --config a.b tip -q
abort: malformed --config option: 'a.b' (use --config section.name=value)
- [255]
+ [10]
$ hg --cwd c --config a tip -q
abort: malformed --config option: 'a' (use --config section.name=value)
- [255]
+ [10]
$ hg --cwd c --config a.= tip -q
abort: malformed --config option: 'a.=' (use --config section.name=value)
- [255]
+ [10]
$ hg --cwd c --config .b= tip -q
abort: malformed --config option: '.b=' (use --config section.name=value)
- [255]
+ [10]
Testing --debug:
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -849,7 +849,7 @@
ui.setconfig(section, name, value, b'--config')
configs.append((section, name, value))
except (IndexError, ValueError):
- raise error.Abort(
+ raise error.InputError(
_(
b'malformed --config option: %r '
b'(use --config section.name=value)'
To: martinvonz, #hg-reviewers, pulkit
Cc: pulkit, mharbison72, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201214/1611df53/attachment.html>
More information about the Mercurial-patches
mailing list