author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
Thu, 12 Aug 2010 19:40:22 +0900 | |
changeset 11794 | 80c63b2a29a8 |
parent 11695 | ee8f36a6c766 |
permissions | -rwxr-xr-x |
4801 | 1 |
#!/bin/sh |
2 |
||
5523
5db730475d6d
tests/*: avoid losing the original settings from $HGRCPATH
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4801
diff
changeset
|
3 |
cat >> $HGRCPATH <<EOF |
4801 | 4 |
[alias] |
5 |
myinit = init |
|
6 |
cleanstatus = status -c |
|
7 |
unknown = bargle |
|
8 |
ambiguous = s |
|
9 |
recursive = recursive |
|
8655 | 10 |
nodefinition = |
11695
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
11 |
no--cwd = status --cwd elsewhere |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
12 |
no-R = status -R elsewhere |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
13 |
no--repo = status --repo elsewhere |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
14 |
no--repository = status --repository elsewhere |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
15 |
mylog = log |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
16 |
lognull = log -r null |
8519
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
17 |
shortlog = log --template '{rev} {node|short} | {date|isodate}\n' |
8655 | 18 |
dln = lognull --debug |
9993
8bce1e0d2801
alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8655
diff
changeset
|
19 |
nousage = rollback |
11460
9e250c145c38
test-alias: don't use the environment variable PWD
Mads Kiilerich <mads@kiilerich.com>
parents:
10793
diff
changeset
|
20 |
put = export -r 0 -o "\$FOO/%R.diff" |
11524
24965bb270b7
dispatch: add shell aliases
Steve Losh <steve@stevelosh.com>
parents:
11460
diff
changeset
|
21 |
echo = !echo |
11676
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
22 |
rt = root |
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
23 |
|
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
24 |
[defaults] |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
25 |
mylog = -q |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
26 |
lognull = -q |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
27 |
log = -v |
4801 | 28 |
EOF |
29 |
||
30 |
echo '% basic' |
|
31 |
hg myinit alias |
|
32 |
||
33 |
echo '% unknown' |
|
34 |
hg unknown |
|
10021
0022f5c5459e
help: don't display bogus help messages for invalid aliases
Brodie Rao <me+hg@dackz.net>
parents:
9993
diff
changeset
|
35 |
hg help unknown |
4801 | 36 |
|
37 |
echo '% ambiguous' |
|
38 |
hg ambiguous |
|
10021
0022f5c5459e
help: don't display bogus help messages for invalid aliases
Brodie Rao <me+hg@dackz.net>
parents:
9993
diff
changeset
|
39 |
hg help ambiguous |
4801 | 40 |
|
41 |
echo '% recursive' |
|
42 |
hg recursive |
|
10021
0022f5c5459e
help: don't display bogus help messages for invalid aliases
Brodie Rao <me+hg@dackz.net>
parents:
9993
diff
changeset
|
43 |
hg help recursive |
4801 | 44 |
|
8655 | 45 |
echo '% no definition' |
46 |
hg nodef |
|
10021
0022f5c5459e
help: don't display bogus help messages for invalid aliases
Brodie Rao <me+hg@dackz.net>
parents:
9993
diff
changeset
|
47 |
hg help nodef |
8655 | 48 |
|
11695
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
49 |
echo '% invalid options' |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
50 |
hg no--cwd |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
51 |
hg help no--cwd |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
52 |
hg no-R |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
53 |
hg help no-R |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
54 |
hg no--repo |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
55 |
hg help no--repo |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
56 |
hg no--repository |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
57 |
hg help no--repository |
ee8f36a6c766
alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
11681
diff
changeset
|
58 |
|
4801 | 59 |
cd alias |
9993
8bce1e0d2801
alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8655
diff
changeset
|
60 |
|
8bce1e0d2801
alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8655
diff
changeset
|
61 |
echo '% no usage' |
8bce1e0d2801
alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8655
diff
changeset
|
62 |
hg nousage |
8bce1e0d2801
alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents:
8655
diff
changeset
|
63 |
|
4801 | 64 |
echo foo > foo |
65 |
hg ci -Amfoo |
|
66 |
||
67 |
echo '% with opts' |
|
68 |
hg cleanst |
|
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
69 |
|
8519
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
70 |
echo '% with opts and whitespace' |
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
71 |
hg shortlog |
5fbee915ea5d
alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
8477
diff
changeset
|
72 |
|
8477
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
73 |
echo '% interaction with defaults' |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
74 |
hg mylog |
a0104303f400
alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
5523
diff
changeset
|
75 |
hg lognull |
8655 | 76 |
|
77 |
echo '% properly recursive' |
|
78 |
hg dln |
|
10793
16df09a54113
expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents:
10021
diff
changeset
|
79 |
|
16df09a54113
expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents:
10021
diff
changeset
|
80 |
echo '% path expanding' |
11460
9e250c145c38
test-alias: don't use the environment variable PWD
Mads Kiilerich <mads@kiilerich.com>
parents:
10793
diff
changeset
|
81 |
FOO=`pwd` hg put |
10793
16df09a54113
expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents:
10021
diff
changeset
|
82 |
cat 0.diff |
11676
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
83 |
|
11524
24965bb270b7
dispatch: add shell aliases
Steve Losh <steve@stevelosh.com>
parents:
11460
diff
changeset
|
84 |
echo '% shell aliases' |
24965bb270b7
dispatch: add shell aliases
Steve Losh <steve@stevelosh.com>
parents:
11460
diff
changeset
|
85 |
hg echo foo |
11676
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
86 |
echo '% invalid arguments' |
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
87 |
hg rt foo |
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
88 |
|
e4357c214bf1
alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents:
11460
diff
changeset
|
89 |
exit 0 |