Mercurial > public > mercurial-scm > hg
comparison mercurial/dispatch.py @ 45918:ac565222b9f8
errors: raise InputError on bad top-level flags
Differential Revision: https://phab.mercurial-scm.org/D9388
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 23 Nov 2020 10:39:51 -0800 |
parents | be25b66f86ab |
children | 1441f4d57083 |
comparison
equal
deleted
inserted
replaced
45917:721f765a34ac | 45918:ac565222b9f8 |
---|---|
1056 | 1056 |
1057 # store the canonical command name in request object for later access | 1057 # store the canonical command name in request object for later access |
1058 req.canonical_command = cmd | 1058 req.canonical_command = cmd |
1059 | 1059 |
1060 if options[b"config"] != req.earlyoptions[b"config"]: | 1060 if options[b"config"] != req.earlyoptions[b"config"]: |
1061 raise error.Abort(_(b"option --config may not be abbreviated")) | 1061 raise error.InputError(_(b"option --config may not be abbreviated")) |
1062 if options[b"cwd"] != req.earlyoptions[b"cwd"]: | 1062 if options[b"cwd"] != req.earlyoptions[b"cwd"]: |
1063 raise error.Abort(_(b"option --cwd may not be abbreviated")) | 1063 raise error.InputError(_(b"option --cwd may not be abbreviated")) |
1064 if options[b"repository"] != req.earlyoptions[b"repository"]: | 1064 if options[b"repository"] != req.earlyoptions[b"repository"]: |
1065 raise error.Abort( | 1065 raise error.InputError( |
1066 _( | 1066 _( |
1067 b"option -R has to be separated from other options (e.g. not " | 1067 b"option -R has to be separated from other options (e.g. not " |
1068 b"-qR) and --repository may only be abbreviated as --repo" | 1068 b"-qR) and --repository may only be abbreviated as --repo" |
1069 ) | 1069 ) |
1070 ) | 1070 ) |
1071 if options[b"debugger"] != req.earlyoptions[b"debugger"]: | 1071 if options[b"debugger"] != req.earlyoptions[b"debugger"]: |
1072 raise error.Abort(_(b"option --debugger may not be abbreviated")) | 1072 raise error.InputError( |
1073 _(b"option --debugger may not be abbreviated") | |
1074 ) | |
1073 # don't validate --profile/--traceback, which can be enabled from now | 1075 # don't validate --profile/--traceback, which can be enabled from now |
1074 | 1076 |
1075 if options[b"encoding"]: | 1077 if options[b"encoding"]: |
1076 encoding.encoding = options[b"encoding"] | 1078 encoding.encoding = options[b"encoding"] |
1077 if options[b"encodingmode"]: | 1079 if options[b"encodingmode"]: |