##// END OF EJS Templates
dispatch: convert non-list option parsed by _earlygetopt() to string...
dispatch: convert non-list option parsed by _earlygetopt() to string So we can easily compare it with the corresponding getopt() result. There's a minor behavior change. Before, "hg --cwd ''" failed with ENOENT. But with this patch, an empty cwd is silently ignored. "hg -R ''" has always worked as such, so -R has no BC.

File last commit:

r35059:d9aba373 stable
r35062:d3d35a55 stable
Show More
test-dispatch.t
107 lines | 2.3 KiB | text/troff | Tads3Lexer
Adrian Buehlmann
tests: unify test-dispatch
r12157 test command parsing and dispatch
$ hg init a
$ cd a
Nicolas Dumazet
tests: move test-issue436 in test-dispatch where fancyopts is tested
r14115
Redundant options used to crash (issue436):
$ hg -v log -v
$ hg -v log -v x
Adrian Buehlmann
tests: unify test-dispatch
r12157 $ echo a > a
$ hg ci -Ama
adding a
Missing arg:
$ hg cat
hg cat: invalid arguments
hg cat [OPTION]... FILE...
output the current or given revision of files
Matt Mackall
help: fold repeatable option message into option table header...
r22117 options ([+] can be repeated):
Adrian Buehlmann
tests: unify test-dispatch
r12157
Matt Mackall
help: use RST to format option lists
r15145 -o --output FORMAT print output to file with formatted name
-r --rev REV print the given revision
Pierre-Yves David
help: backout f3c4edfd35e1 (mark boolean flags with [no-] in help) for now...
r30152 --decode apply any matching decode filter
Matt Mackall
help: use RST to format option lists
r15145 -I --include PATTERN [+] include names matching the given patterns
-X --exclude PATTERN [+] exclude names matching the given patterns
Adrian Buehlmann
tests: unify test-dispatch
r12157
timeless
help: use single quotes in use warning
r29974 (use 'hg cat -h' to show more help)
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-dispatch
r12157
Yuya Nishihara
dispatch: do not drop unpaired argument at _earlygetopt()...
r35056 Missing parameter for early option:
$ hg log -R 2>&1 | grep 'hg log'
hg log: option -R requires argument
hg log [OPTION]... [FILE]
(use 'hg log -h' to show more help)
$ hg log -R -- 2>&1 | grep 'hg log'
hg log: option -R requires argument
hg log [OPTION]... [FILE]
(use 'hg log -h' to show more help)
Yuya Nishihara
dispatch: stop parsing of early boolean option at "--"
r35058 Parsing of early options should stop at "--":
$ hg cat -- --config=hooks.pre-cat=false
--config=hooks.pre-cat=false: no such file in rev cb9a9f314b8b
[1]
$ hg cat -- --debugger
--debugger: no such file in rev cb9a9f314b8b
[1]
Yuya Nishihara
dispatch: abort if early boolean options can't be parsed...
r35059 Unparsable form of early options:
$ hg cat --debugg
abort: option --debugger may not be abbreviated!
[255]
Adrian Buehlmann
tests: unify test-dispatch
r12157 [defaults]
$ hg cat a
a
$ cat >> $HGRCPATH <<EOF
> [defaults]
> cat = -r null
> EOF
$ hg cat a
a: no such file in rev 000000000000
Matt Mackall
tests: add exit codes to unified tests
r12316 [1]
Adrian Buehlmann
tests: unify test-dispatch
r12157
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 $ cd "$TESTTMP"
Mads Kiilerich
tests: fix for windows - slashes and no serve
r18506 OSError "No such file or directory" / "The system cannot find the path
specified" should include filename even when it is empty
Mads Kiilerich
dispatch: show empty filename in OSError aborts...
r18227
$ hg -R a archive ''
Mads Kiilerich
tests: fix for windows - slashes and no serve
r18506 abort: *: '' (glob)
Mads Kiilerich
dispatch: show empty filename in OSError aborts...
r18227 [255]
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #if no-outer-repo
Adrian Buehlmann
tests: unify test-dispatch
r12157 No repo:
$ hg cat
Matt Mackall
dispatch: improve repository not found message...
r13967 abort: no repository found in '$TESTTMP' (.hg not found)!
Matt Mackall
tests: add exit codes to unified tests
r12316 [255]
Adrian Buehlmann
tests: unify test-dispatch
r12157
Mads Kiilerich
tests: convert some 'hghave no-outer-repo' to #if...
r17014 #endif
Jun Wu
hgweb: do not import uuid immediately to avoid its side effect...
r34644
#if rmcwd
Current directory removed:
$ mkdir $TESTTMP/repo1
$ cd $TESTTMP/repo1
$ rm -rf $TESTTMP/repo1
Jun Wu
test-dispatch: stabilize the test...
r34954
The output could be one of the following and something else:
chg: abort: failed to getcwd (errno = *) (glob)
abort: error getting current working directory: * (glob)
sh: 0: getcwd() failed: No such file or directory
Since the exact behavior depends on the shell, only check it returns non-zero.
$ HGDEMANDIMPORT=disable hg version -q 2>/dev/null || false
[1]
Jun Wu
hgweb: do not import uuid immediately to avoid its side effect...
r34644
#endif