dispatch: remove strictflags and related tests

Reviewed By: quark-zju

Differential Revision: D15833690

fbshipit-source-id: 3469d8def660b116c0f82c674a19f06b18f29211
This commit is contained in:
Jared Bosco 2019-07-20 01:01:33 -07:00 committed by Facebook Github Bot
parent 9984985969
commit 95b0be5bdc
2 changed files with 1 additions and 47 deletions

View File

@ -1082,7 +1082,7 @@ def _earlyparseopts(ui, args):
args,
commands.globalopts,
options,
gnu=not ui.plain("strictflags"),
gnu=True,
early=True,
optaliases={"repository": ["repo"]},
)

View File

@ -113,52 +113,6 @@ Shell aliases bypass any command parsing rules but for the early one:
$ hg log -b '--config=alias.log=!echo howdy'
howdy
Early options must come first if HGPLAIN=+strictflags is specified:
(BUG: chg cherry-picks early options to pass them as a server command)
#if no-chg
$ HGPLAIN=+strictflags hg log -b --config='hooks.pre-log=false' default
abort: unknown revision '--config=hooks.pre-log=false'!
(if --config=hooks.pre-log=false is a remote bookmark or commit, try to 'hg pull' it first)
[255]
$ HGPLAIN=+strictflags hg log -b -R. default
abort: unknown revision '-R.'!
(if -R. is a remote bookmark or commit, try to 'hg pull' it first)
[255]
$ HGPLAIN=+strictflags hg log -b --cwd=. default
abort: unknown revision '--cwd=.'!
(if --cwd=. is a remote bookmark or commit, try to 'hg pull' it first)
[255]
#endif
$ HGPLAIN=+strictflags hg log -b --debugger default
abort: unknown revision '--debugger'!
(if --debugger is a remote bookmark or commit, try to 'hg pull' it first)
[255]
$ HGPLAIN=+strictflags hg log -b --config='alias.log=!echo pwned' default
abort: unknown revision '--config=alias.log=!echo pwned'!
(if --config=alias.log=!echo pwned is a remote bookmark or commit, try to 'hg pull' it first)
[255]
$ HGPLAIN=+strictflags hg log --config='hooks.pre-log=false' -b default
abort: option --config may not be abbreviated!
[255]
$ HGPLAIN=+strictflags hg log -q --cwd=.. -b default
abort: option --cwd may not be abbreviated!
[255]
$ HGPLAIN=+strictflags hg log -q -R . -b default
abort: option -R has to be separated from other options (e.g. not -qR) and --repository may only be abbreviated as --repo!
[255]
$ HGPLAIN=+strictflags hg --config='hooks.pre-log=false' log -b default
abort: pre-log hook exited with status 1
[255]
$ HGPLAIN=+strictflags hg --cwd .. -q -Ra log -b default
0:cb9a9f314b8b
$ HGPLAIN=+strictflags hg --cwd .. -q --repository a log -b default
0:cb9a9f314b8b
$ HGPLAIN=+strictflags hg --cwd .. -q --repo a log -b default
0:cb9a9f314b8b
For compatibility reasons, HGPLAIN=+strictflags is not enabled by plain HGPLAIN:
$ HGPLAIN= hg log --config='hooks.pre-log=false' -b default