comparison tests/test-blackbox.t @ 35034:02845f7441af stable

dispatch: verify result of early command parsing Before, early options were stripped from args, and because of this, some kind of parsing errors weren't reported. For example, $ hg ci -m -Ra file would execute "hg ci -m file" in repository "a". This patch fixes the issue by parsing early options again by real getopt-based parser, and verifying the results. If the early parsing appears wrong, hg just aborts. The current error message seems not nice, and should be improved, maybe in V2 or follow-up. Note that this isn't a security feature because we can still do anything by using shell aliases.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 11 Nov 2017 12:40:13 +0900
parents eb586ed5d8ce
children 4441705b7111
comparison
equal deleted inserted replaced
35033:d3d35a55e03b 35034:02845f7441af
17 $ hg add a 17 $ hg add a
18 $ hg blackbox --config blackbox.dirty=True 18 $ hg blackbox --config blackbox.dirty=True
19 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob) 19 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> init blackboxtest exited 0 after * seconds (glob)
20 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a 20 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a
21 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob) 21 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000 (5000)> add a exited 0 after * seconds (glob)
22 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox 22 1970/01/01 00:00:00 bob @0000000000000000000000000000000000000000+ (5000)> blackbox --config *blackbox.dirty=True* (glob)
23 23
24 alias expansion is logged 24 alias expansion is logged
25 $ rm ./.hg/blackbox.log 25 $ rm ./.hg/blackbox.log
26 $ hg confuse 26 $ hg confuse
27 $ hg blackbox 27 $ hg blackbox