Mercurial > hg
comparison tests/test-alias.t @ 11814:61b0a01182d5
tests: unify test-alias
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Thu, 12 Aug 2010 23:46:56 +0900 |
parents | tests/test-alias@ee8f36a6c766 |
children | f853873fc66d |
comparison
equal
deleted
inserted
replaced
11813:6c8e824970d1 | 11814:61b0a01182d5 |
---|---|
1 $ cat >> $HGRCPATH <<EOF | |
2 > [alias] | |
3 > myinit = init | |
4 > cleanstatus = status -c | |
5 > unknown = bargle | |
6 > ambiguous = s | |
7 > recursive = recursive | |
8 > nodefinition = | |
9 > no--cwd = status --cwd elsewhere | |
10 > no-R = status -R elsewhere | |
11 > no--repo = status --repo elsewhere | |
12 > no--repository = status --repository elsewhere | |
13 > mylog = log | |
14 > lognull = log -r null | |
15 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n' | |
16 > dln = lognull --debug | |
17 > nousage = rollback | |
18 > put = export -r 0 -o "\$FOO/%R.diff" | |
19 > echo = !echo | |
20 > rt = root | |
21 > | |
22 > [defaults] | |
23 > mylog = -q | |
24 > lognull = -q | |
25 > log = -v | |
26 > EOF | |
27 | |
28 | |
29 basic | |
30 | |
31 $ hg myinit alias | |
32 | |
33 | |
34 unknown | |
35 | |
36 $ hg unknown | |
37 alias 'unknown' resolves to unknown command 'bargle' | |
38 $ hg help unknown | |
39 alias 'unknown' resolves to unknown command 'bargle' | |
40 | |
41 | |
42 ambiguous | |
43 | |
44 $ hg ambiguous | |
45 alias 'ambiguous' resolves to ambiguous command 's' | |
46 $ hg help ambiguous | |
47 alias 'ambiguous' resolves to ambiguous command 's' | |
48 | |
49 | |
50 recursive | |
51 | |
52 $ hg recursive | |
53 alias 'recursive' resolves to unknown command 'recursive' | |
54 $ hg help recursive | |
55 alias 'recursive' resolves to unknown command 'recursive' | |
56 | |
57 | |
58 no definition | |
59 | |
60 $ hg nodef | |
61 no definition for alias 'nodefinition' | |
62 $ hg help nodef | |
63 no definition for alias 'nodefinition' | |
64 | |
65 | |
66 invalid options | |
67 | |
68 $ hg no--cwd | |
69 error in definition for alias 'no--cwd': --cwd may only be given on the command line | |
70 $ hg help no--cwd | |
71 error in definition for alias 'no--cwd': --cwd may only be given on the command line | |
72 $ hg no-R | |
73 error in definition for alias 'no-R': -R may only be given on the command line | |
74 $ hg help no-R | |
75 error in definition for alias 'no-R': -R may only be given on the command line | |
76 $ hg no--repo | |
77 error in definition for alias 'no--repo': --repo may only be given on the command line | |
78 $ hg help no--repo | |
79 error in definition for alias 'no--repo': --repo may only be given on the command line | |
80 $ hg no--repository | |
81 error in definition for alias 'no--repository': --repository may only be given on the command line | |
82 $ hg help no--repository | |
83 error in definition for alias 'no--repository': --repository may only be given on the command line | |
84 | |
85 $ cd alias | |
86 | |
87 | |
88 no usage | |
89 | |
90 $ hg nousage | |
91 no rollback information available | |
92 | |
93 $ echo foo > foo | |
94 $ hg ci -Amfoo | |
95 adding foo | |
96 | |
97 | |
98 with opts | |
99 | |
100 $ hg cleanst | |
101 C foo | |
102 | |
103 | |
104 with opts and whitespace | |
105 | |
106 $ hg shortlog | |
107 0 e63c23eaa88a | 1970-01-01 00:00 +0000 | |
108 | |
109 | |
110 interaction with defaults | |
111 | |
112 $ hg mylog | |
113 0:e63c23eaa88a | |
114 $ hg lognull | |
115 -1:000000000000 | |
116 | |
117 | |
118 properly recursive | |
119 | |
120 $ hg dln | |
121 changeset: -1:0000000000000000000000000000000000000000 | |
122 parent: -1:0000000000000000000000000000000000000000 | |
123 parent: -1:0000000000000000000000000000000000000000 | |
124 manifest: -1:0000000000000000000000000000000000000000 | |
125 user: | |
126 date: Thu Jan 01 00:00:00 1970 +0000 | |
127 extra: branch=default | |
128 | |
129 | |
130 | |
131 path expanding | |
132 | |
133 $ FOO=`pwd` hg put | |
134 $ cat 0.diff | |
135 # HG changeset patch | |
136 # User test | |
137 # Date 0 0 | |
138 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0 | |
139 # Parent 0000000000000000000000000000000000000000 | |
140 foo | |
141 | |
142 diff -r 000000000000 -r e63c23eaa88a foo | |
143 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
144 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 | |
145 @@ -0,0 +1,1 @@ | |
146 +foo | |
147 | |
148 | |
149 shell aliases | |
150 | |
151 $ hg echo foo | |
152 foo | |
153 | |
154 invalid arguments | |
155 | |
156 $ hg rt foo | |
157 hg rt: invalid arguments | |
158 hg rt | |
159 | |
160 alias for: hg root | |
161 | |
162 print the root (top) of the current working directory | |
163 | |
164 Print the root directory of the current repository. | |
165 | |
166 Returns 0 on success. | |
167 | |
168 use "hg -v help rt" to show global options | |
169 | |
170 $ exit 0 |