errors: raise InputError on bad repo arguments
I'm not sure if one of these should be StateError...
Differential Revision: https://phab.mercurial-scm.org/D9383
--- a/mercurial/dispatch.py Mon Nov 23 14:48:05 2020 -0800
+++ b/mercurial/dispatch.py Mon Nov 23 10:42:03 2020 -0800
@@ -1174,7 +1174,7 @@
intents=func.intents,
)
if not repo.local():
- raise error.Abort(
+ raise error.InputError(
_(b"repository '%s' is not local") % path
)
repo.ui.setconfig(
@@ -1195,7 +1195,7 @@
req.earlyoptions[b'repository'] = guess
return _dispatch(req)
if not path:
- raise error.RepoError(
+ raise error.InputError(
_(
b"no repository found in"
b" '%s' (.hg not found)"
--- a/tests/test-alias.t Mon Nov 23 14:48:05 2020 -0800
+++ b/tests/test-alias.t Mon Nov 23 10:42:03 2020 -0800
@@ -715,8 +715,8 @@
#if no-outer-repo
$ hg root
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
$ hg --config alias.hgroot='!hg root' hgroot
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
#endif
--- a/tests/test-dispatch.t Mon Nov 23 14:48:05 2020 -0800
+++ b/tests/test-dispatch.t Mon Nov 23 10:42:03 2020 -0800
@@ -198,7 +198,7 @@
$ hg cat
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
#endif
--- a/tests/test-globalopts.t Mon Nov 23 14:48:05 2020 -0800
+++ b/tests/test-globalopts.t Mon Nov 23 10:42:03 2020 -0800
@@ -86,14 +86,14 @@
0: a
$ hg ann a/a b/b
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
$ hg -R b ann a/a
abort: a/a not under root '$TESTTMP/b'
(consider using '--cwd b')
[255]
$ hg log
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
#endif
--- a/tests/test-i18n.t Mon Nov 23 14:48:05 2020 -0800
+++ b/tests/test-i18n.t Mon Nov 23 10:42:03 2020 -0800
@@ -9,19 +9,19 @@
$ LANGUAGE=pt_BR hg tip
abortado: n?o foi encontrado um reposit?rio em '$TESTTMP' (.hg n?o encontrado)
- [255]
+ [10]
Using a more accommodating encoding:
$ HGENCODING=UTF-8 LANGUAGE=pt_BR hg tip
abortado: n\xc3\xa3o foi encontrado um reposit\xc3\xb3rio em '$TESTTMP' (.hg n\xc3\xa3o encontrado) (esc)
- [255]
+ [10]
Different encoding:
$ HGENCODING=Latin-1 LANGUAGE=pt_BR hg tip
abortado: n\xe3o foi encontrado um reposit\xf3rio em '$TESTTMP' (.hg n\xe3o encontrado) (esc)
- [255]
+ [10]
#endif
--- a/tests/test-update-branches.t Mon Nov 23 14:48:05 2020 -0800
+++ b/tests/test-update-branches.t Mon Nov 23 10:42:03 2020 -0800
@@ -58,7 +58,7 @@
$ cd ..
$ hg update b1
abort: no repository found in '$TESTTMP' (.hg not found)
- [255]
+ [10]
$ cd b1
Test helper functions: