##// END OF EJS Templates
hg.bat: return exit code explicitly for indirect invocation...
FUJIWARA Katsunori -
r23934:975c4fc4 stable
parent child Browse files
Show More
@@ -1,17 +1,19 b''
1 @echo off
1 @echo off
2 rem Windows Driver script for Mercurial
2 rem Windows Driver script for Mercurial
3
3
4 setlocal
4 setlocal
5 set HG=%~f0
5 set HG=%~f0
6
6
7 rem Use a full path to Python (relative to this script) if it exists,
7 rem Use a full path to Python (relative to this script) if it exists,
8 rem as the standard Python install does not put python.exe on the PATH...
8 rem as the standard Python install does not put python.exe on the PATH...
9 rem Otherwise, expect that python.exe can be found on the PATH.
9 rem Otherwise, expect that python.exe can be found on the PATH.
10 rem %~dp0 is the directory of this script
10 rem %~dp0 is the directory of this script
11
11
12 if exist "%~dp0..\python.exe" (
12 if exist "%~dp0..\python.exe" (
13 "%~dp0..\python" "%~dp0hg" %*
13 "%~dp0..\python" "%~dp0hg" %*
14 ) else (
14 ) else (
15 python "%~dp0hg" %*
15 python "%~dp0hg" %*
16 )
16 )
17 endlocal
17 endlocal
18
19 exit /b %ERRORLEVEL%
@@ -1,527 +1,536 b''
1 $ HGFOO=BAR; export HGFOO
1 $ HGFOO=BAR; export HGFOO
2 $ cat >> $HGRCPATH <<EOF
2 $ cat >> $HGRCPATH <<EOF
3 > [alias]
3 > [alias]
4 > # should clobber ci but not commit (issue2993)
4 > # should clobber ci but not commit (issue2993)
5 > ci = version
5 > ci = version
6 > myinit = init
6 > myinit = init
7 > mycommit = commit
7 > mycommit = commit
8 > optionalrepo = showconfig alias.myinit
8 > optionalrepo = showconfig alias.myinit
9 > cleanstatus = status -c
9 > cleanstatus = status -c
10 > unknown = bargle
10 > unknown = bargle
11 > ambiguous = s
11 > ambiguous = s
12 > recursive = recursive
12 > recursive = recursive
13 > disabled = email
13 > disabled = email
14 > nodefinition =
14 > nodefinition =
15 > noclosingquotation = '
15 > noclosingquotation = '
16 > no--cwd = status --cwd elsewhere
16 > no--cwd = status --cwd elsewhere
17 > no-R = status -R elsewhere
17 > no-R = status -R elsewhere
18 > no--repo = status --repo elsewhere
18 > no--repo = status --repo elsewhere
19 > no--repository = status --repository elsewhere
19 > no--repository = status --repository elsewhere
20 > no--config = status --config a.config=1
20 > no--config = status --config a.config=1
21 > mylog = log
21 > mylog = log
22 > lognull = log -r null
22 > lognull = log -r null
23 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
23 > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
24 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
24 > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
25 > dln = lognull --debug
25 > dln = lognull --debug
26 > nousage = rollback
26 > nousage = rollback
27 > put = export -r 0 -o "\$FOO/%R.diff"
27 > put = export -r 0 -o "\$FOO/%R.diff"
28 > blank = !printf '\n'
28 > blank = !printf '\n'
29 > self = !printf '\$0\n'
29 > self = !printf '\$0\n'
30 > echoall = !printf '\$@\n'
30 > echoall = !printf '\$@\n'
31 > echo1 = !printf '\$1\n'
31 > echo1 = !printf '\$1\n'
32 > echo2 = !printf '\$2\n'
32 > echo2 = !printf '\$2\n'
33 > echo13 = !printf '\$1 \$3\n'
33 > echo13 = !printf '\$1 \$3\n'
34 > echotokens = !printf "%s\n" "\$@"
34 > echotokens = !printf "%s\n" "\$@"
35 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
35 > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
36 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
36 > mcount = !hg log \$@ --template=. | wc -c | sed -e 's/ //g'
37 > rt = root
37 > rt = root
38 > tglog = log -G --template "{rev}:{node|short}: '{desc}' {branches}\n"
38 > tglog = log -G --template "{rev}:{node|short}: '{desc}' {branches}\n"
39 > idalias = id
39 > idalias = id
40 > idaliaslong = id
40 > idaliaslong = id
41 > idaliasshell = !echo test
41 > idaliasshell = !echo test
42 > parentsshell1 = !echo one
42 > parentsshell1 = !echo one
43 > parentsshell2 = !echo two
43 > parentsshell2 = !echo two
44 > escaped1 = !printf 'test\$\$test\n'
44 > escaped1 = !printf 'test\$\$test\n'
45 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
45 > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
46 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
46 > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
47 > escaped4 = !printf '\$\$0 \$\$@\n'
47 > escaped4 = !printf '\$\$0 \$\$@\n'
48 > exit1 = !sh -c 'exit 1'
48 > exit1 = !sh -c 'exit 1'
49 >
49 >
50 > [defaults]
50 > [defaults]
51 > mylog = -q
51 > mylog = -q
52 > lognull = -q
52 > lognull = -q
53 > log = -v
53 > log = -v
54 > EOF
54 > EOF
55
55
56
56
57 basic
57 basic
58
58
59 $ hg myinit alias
59 $ hg myinit alias
60
60
61
61
62 unknown
62 unknown
63
63
64 $ hg unknown
64 $ hg unknown
65 abort: alias 'unknown' resolves to unknown command 'bargle'
65 abort: alias 'unknown' resolves to unknown command 'bargle'
66 [255]
66 [255]
67 $ hg help unknown
67 $ hg help unknown
68 alias 'unknown' resolves to unknown command 'bargle'
68 alias 'unknown' resolves to unknown command 'bargle'
69
69
70
70
71 ambiguous
71 ambiguous
72
72
73 $ hg ambiguous
73 $ hg ambiguous
74 abort: alias 'ambiguous' resolves to ambiguous command 's'
74 abort: alias 'ambiguous' resolves to ambiguous command 's'
75 [255]
75 [255]
76 $ hg help ambiguous
76 $ hg help ambiguous
77 alias 'ambiguous' resolves to ambiguous command 's'
77 alias 'ambiguous' resolves to ambiguous command 's'
78
78
79
79
80 recursive
80 recursive
81
81
82 $ hg recursive
82 $ hg recursive
83 abort: alias 'recursive' resolves to unknown command 'recursive'
83 abort: alias 'recursive' resolves to unknown command 'recursive'
84 [255]
84 [255]
85 $ hg help recursive
85 $ hg help recursive
86 alias 'recursive' resolves to unknown command 'recursive'
86 alias 'recursive' resolves to unknown command 'recursive'
87
87
88
88
89 disabled
89 disabled
90
90
91 $ hg disabled
91 $ hg disabled
92 abort: alias 'disabled' resolves to unknown command 'email'
92 abort: alias 'disabled' resolves to unknown command 'email'
93 ('email' is provided by 'patchbomb' extension)
93 ('email' is provided by 'patchbomb' extension)
94 [255]
94 [255]
95 $ hg help disabled
95 $ hg help disabled
96 alias 'disabled' resolves to unknown command 'email'
96 alias 'disabled' resolves to unknown command 'email'
97
97
98 'email' is provided by the following extension:
98 'email' is provided by the following extension:
99
99
100 patchbomb command to send changesets as (a series of) patch emails
100 patchbomb command to send changesets as (a series of) patch emails
101
101
102 (use "hg help extensions" for information on enabling extensions)
102 (use "hg help extensions" for information on enabling extensions)
103
103
104
104
105 no definition
105 no definition
106
106
107 $ hg nodef
107 $ hg nodef
108 abort: no definition for alias 'nodefinition'
108 abort: no definition for alias 'nodefinition'
109 [255]
109 [255]
110 $ hg help nodef
110 $ hg help nodef
111 no definition for alias 'nodefinition'
111 no definition for alias 'nodefinition'
112
112
113
113
114 no closing quotation
114 no closing quotation
115
115
116 $ hg noclosing
116 $ hg noclosing
117 abort: error in definition for alias 'noclosingquotation': No closing quotation
117 abort: error in definition for alias 'noclosingquotation': No closing quotation
118 [255]
118 [255]
119 $ hg help noclosing
119 $ hg help noclosing
120 error in definition for alias 'noclosingquotation': No closing quotation
120 error in definition for alias 'noclosingquotation': No closing quotation
121
121
122
122
123 invalid options
123 invalid options
124
124
125 $ hg no--cwd
125 $ hg no--cwd
126 abort: error in definition for alias 'no--cwd': --cwd may only be given on the command line
126 abort: error in definition for alias 'no--cwd': --cwd may only be given on the command line
127 [255]
127 [255]
128 $ hg help no--cwd
128 $ hg help no--cwd
129 error in definition for alias 'no--cwd': --cwd may only be given on the
129 error in definition for alias 'no--cwd': --cwd may only be given on the
130 command line
130 command line
131 $ hg no-R
131 $ hg no-R
132 abort: error in definition for alias 'no-R': -R may only be given on the command line
132 abort: error in definition for alias 'no-R': -R may only be given on the command line
133 [255]
133 [255]
134 $ hg help no-R
134 $ hg help no-R
135 error in definition for alias 'no-R': -R may only be given on the command line
135 error in definition for alias 'no-R': -R may only be given on the command line
136 $ hg no--repo
136 $ hg no--repo
137 abort: error in definition for alias 'no--repo': --repo may only be given on the command line
137 abort: error in definition for alias 'no--repo': --repo may only be given on the command line
138 [255]
138 [255]
139 $ hg help no--repo
139 $ hg help no--repo
140 error in definition for alias 'no--repo': --repo may only be given on the
140 error in definition for alias 'no--repo': --repo may only be given on the
141 command line
141 command line
142 $ hg no--repository
142 $ hg no--repository
143 abort: error in definition for alias 'no--repository': --repository may only be given on the command line
143 abort: error in definition for alias 'no--repository': --repository may only be given on the command line
144 [255]
144 [255]
145 $ hg help no--repository
145 $ hg help no--repository
146 error in definition for alias 'no--repository': --repository may only be given
146 error in definition for alias 'no--repository': --repository may only be given
147 on the command line
147 on the command line
148 $ hg no--config
148 $ hg no--config
149 abort: error in definition for alias 'no--config': --config may only be given on the command line
149 abort: error in definition for alias 'no--config': --config may only be given on the command line
150 [255]
150 [255]
151
151
152 optional repository
152 optional repository
153
153
154 #if no-outer-repo
154 #if no-outer-repo
155 $ hg optionalrepo
155 $ hg optionalrepo
156 init
156 init
157 #endif
157 #endif
158 $ cd alias
158 $ cd alias
159 $ cat > .hg/hgrc <<EOF
159 $ cat > .hg/hgrc <<EOF
160 > [alias]
160 > [alias]
161 > myinit = init -q
161 > myinit = init -q
162 > EOF
162 > EOF
163 $ hg optionalrepo
163 $ hg optionalrepo
164 init -q
164 init -q
165
165
166 no usage
166 no usage
167
167
168 $ hg nousage
168 $ hg nousage
169 no rollback information available
169 no rollback information available
170 [1]
170 [1]
171
171
172 $ echo foo > foo
172 $ echo foo > foo
173 $ hg commit -Amfoo
173 $ hg commit -Amfoo
174 adding foo
174 adding foo
175
175
176
176
177 with opts
177 with opts
178
178
179 $ hg cleanst
179 $ hg cleanst
180 C foo
180 C foo
181
181
182
182
183 with opts and whitespace
183 with opts and whitespace
184
184
185 $ hg shortlog
185 $ hg shortlog
186 0 e63c23eaa88a | 1970-01-01 00:00 +0000
186 0 e63c23eaa88a | 1970-01-01 00:00 +0000
187
187
188 positional arguments
188 positional arguments
189
189
190 $ hg positional
190 $ hg positional
191 abort: too few arguments for command alias
191 abort: too few arguments for command alias
192 [255]
192 [255]
193 $ hg positional a
193 $ hg positional a
194 abort: too few arguments for command alias
194 abort: too few arguments for command alias
195 [255]
195 [255]
196 $ hg positional 'node|short' rev
196 $ hg positional 'node|short' rev
197 0 e63c23eaa88a | 1970-01-01 00:00 +0000
197 0 e63c23eaa88a | 1970-01-01 00:00 +0000
198
198
199 interaction with defaults
199 interaction with defaults
200
200
201 $ hg mylog
201 $ hg mylog
202 0:e63c23eaa88a
202 0:e63c23eaa88a
203 $ hg lognull
203 $ hg lognull
204 -1:000000000000
204 -1:000000000000
205
205
206
206
207 properly recursive
207 properly recursive
208
208
209 $ hg dln
209 $ hg dln
210 changeset: -1:0000000000000000000000000000000000000000
210 changeset: -1:0000000000000000000000000000000000000000
211 phase: public
211 phase: public
212 parent: -1:0000000000000000000000000000000000000000
212 parent: -1:0000000000000000000000000000000000000000
213 parent: -1:0000000000000000000000000000000000000000
213 parent: -1:0000000000000000000000000000000000000000
214 manifest: -1:0000000000000000000000000000000000000000
214 manifest: -1:0000000000000000000000000000000000000000
215 user:
215 user:
216 date: Thu Jan 01 00:00:00 1970 +0000
216 date: Thu Jan 01 00:00:00 1970 +0000
217 extra: branch=default
217 extra: branch=default
218
218
219
219
220
220
221 path expanding
221 path expanding
222
222
223 $ FOO=`pwd` hg put
223 $ FOO=`pwd` hg put
224 $ cat 0.diff
224 $ cat 0.diff
225 # HG changeset patch
225 # HG changeset patch
226 # User test
226 # User test
227 # Date 0 0
227 # Date 0 0
228 # Thu Jan 01 00:00:00 1970 +0000
228 # Thu Jan 01 00:00:00 1970 +0000
229 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
229 # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
230 # Parent 0000000000000000000000000000000000000000
230 # Parent 0000000000000000000000000000000000000000
231 foo
231 foo
232
232
233 diff -r 000000000000 -r e63c23eaa88a foo
233 diff -r 000000000000 -r e63c23eaa88a foo
234 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
234 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
235 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
235 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
236 @@ -0,0 +1,1 @@
236 @@ -0,0 +1,1 @@
237 +foo
237 +foo
238
238
239
239
240 simple shell aliases
240 simple shell aliases
241
241
242 $ hg blank
242 $ hg blank
243
243
244 $ hg blank foo
244 $ hg blank foo
245
245
246 $ hg self
246 $ hg self
247 self
247 self
248 $ hg echoall
248 $ hg echoall
249
249
250 $ hg echoall foo
250 $ hg echoall foo
251 foo
251 foo
252 $ hg echoall 'test $2' foo
252 $ hg echoall 'test $2' foo
253 test $2 foo
253 test $2 foo
254 $ hg echoall 'test $@' foo '$@'
254 $ hg echoall 'test $@' foo '$@'
255 test $@ foo $@
255 test $@ foo $@
256 $ hg echoall 'test "$@"' foo '"$@"'
256 $ hg echoall 'test "$@"' foo '"$@"'
257 test "$@" foo "$@"
257 test "$@" foo "$@"
258 $ hg echo1 foo bar baz
258 $ hg echo1 foo bar baz
259 foo
259 foo
260 $ hg echo2 foo bar baz
260 $ hg echo2 foo bar baz
261 bar
261 bar
262 $ hg echo13 foo bar baz test
262 $ hg echo13 foo bar baz test
263 foo baz
263 foo baz
264 $ hg echo2 foo
264 $ hg echo2 foo
265
265
266 $ hg echotokens
266 $ hg echotokens
267
267
268 $ hg echotokens foo 'bar $1 baz'
268 $ hg echotokens foo 'bar $1 baz'
269 foo
269 foo
270 bar $1 baz
270 bar $1 baz
271 $ hg echotokens 'test $2' foo
271 $ hg echotokens 'test $2' foo
272 test $2
272 test $2
273 foo
273 foo
274 $ hg echotokens 'test $@' foo '$@'
274 $ hg echotokens 'test $@' foo '$@'
275 test $@
275 test $@
276 foo
276 foo
277 $@
277 $@
278 $ hg echotokens 'test "$@"' foo '"$@"'
278 $ hg echotokens 'test "$@"' foo '"$@"'
279 test "$@"
279 test "$@"
280 foo
280 foo
281 "$@"
281 "$@"
282 $ echo bar > bar
282 $ echo bar > bar
283 $ hg commit -qA -m bar
283 $ hg commit -qA -m bar
284 $ hg count .
284 $ hg count .
285 1
285 1
286 $ hg count 'branch(default)'
286 $ hg count 'branch(default)'
287 2
287 2
288 $ hg mcount -r '"branch(default)"'
288 $ hg mcount -r '"branch(default)"'
289 2
289 2
290
290
291 $ hg tglog
291 $ hg tglog
292 @ 1:042423737847: 'bar'
292 @ 1:042423737847: 'bar'
293 |
293 |
294 o 0:e63c23eaa88a: 'foo'
294 o 0:e63c23eaa88a: 'foo'
295
295
296
296
297
297
298 shadowing
298 shadowing
299
299
300 $ hg i
300 $ hg i
301 hg: command 'i' is ambiguous:
301 hg: command 'i' is ambiguous:
302 idalias idaliaslong idaliasshell identify import incoming init
302 idalias idaliaslong idaliasshell identify import incoming init
303 [255]
303 [255]
304 $ hg id
304 $ hg id
305 042423737847 tip
305 042423737847 tip
306 $ hg ida
306 $ hg ida
307 hg: command 'ida' is ambiguous:
307 hg: command 'ida' is ambiguous:
308 idalias idaliaslong idaliasshell
308 idalias idaliaslong idaliasshell
309 [255]
309 [255]
310 $ hg idalias
310 $ hg idalias
311 042423737847 tip
311 042423737847 tip
312 $ hg idaliasl
312 $ hg idaliasl
313 042423737847 tip
313 042423737847 tip
314 $ hg idaliass
314 $ hg idaliass
315 test
315 test
316 $ hg parentsshell
316 $ hg parentsshell
317 hg: command 'parentsshell' is ambiguous:
317 hg: command 'parentsshell' is ambiguous:
318 parentsshell1 parentsshell2
318 parentsshell1 parentsshell2
319 [255]
319 [255]
320 $ hg parentsshell1
320 $ hg parentsshell1
321 one
321 one
322 $ hg parentsshell2
322 $ hg parentsshell2
323 two
323 two
324
324
325
325
326 shell aliases with global options
326 shell aliases with global options
327
327
328 $ hg init sub
328 $ hg init sub
329 $ cd sub
329 $ cd sub
330 $ hg count 'branch(default)'
330 $ hg count 'branch(default)'
331 abort: unknown revision 'default'!
331 abort: unknown revision 'default'!
332 0
332 0
333 $ hg -v count 'branch(default)'
333 $ hg -v count 'branch(default)'
334 abort: unknown revision 'default'!
334 abort: unknown revision 'default'!
335 0
335 0
336 $ hg -R .. count 'branch(default)'
336 $ hg -R .. count 'branch(default)'
337 abort: unknown revision 'default'!
337 abort: unknown revision 'default'!
338 0
338 0
339 $ hg --cwd .. count 'branch(default)'
339 $ hg --cwd .. count 'branch(default)'
340 2
340 2
341 $ hg echoall --cwd ..
341 $ hg echoall --cwd ..
342
342
343
343
344
344
345 repo specific shell aliases
345 repo specific shell aliases
346
346
347 $ cat >> .hg/hgrc <<EOF
347 $ cat >> .hg/hgrc <<EOF
348 > [alias]
348 > [alias]
349 > subalias = !echo sub
349 > subalias = !echo sub
350 > EOF
350 > EOF
351 $ cat >> ../.hg/hgrc <<EOF
351 $ cat >> ../.hg/hgrc <<EOF
352 > [alias]
352 > [alias]
353 > mainalias = !echo main
353 > mainalias = !echo main
354 > EOF
354 > EOF
355
355
356
356
357 shell alias defined in current repo
357 shell alias defined in current repo
358
358
359 $ hg subalias
359 $ hg subalias
360 sub
360 sub
361 $ hg --cwd .. subalias > /dev/null
361 $ hg --cwd .. subalias > /dev/null
362 hg: unknown command 'subalias'
362 hg: unknown command 'subalias'
363 [255]
363 [255]
364 $ hg -R .. subalias > /dev/null
364 $ hg -R .. subalias > /dev/null
365 hg: unknown command 'subalias'
365 hg: unknown command 'subalias'
366 [255]
366 [255]
367
367
368
368
369 shell alias defined in other repo
369 shell alias defined in other repo
370
370
371 $ hg mainalias > /dev/null
371 $ hg mainalias > /dev/null
372 hg: unknown command 'mainalias'
372 hg: unknown command 'mainalias'
373 [255]
373 [255]
374 $ hg -R .. mainalias
374 $ hg -R .. mainalias
375 main
375 main
376 $ hg --cwd .. mainalias
376 $ hg --cwd .. mainalias
377 main
377 main
378
378
379
379
380 shell aliases with escaped $ chars
380 shell aliases with escaped $ chars
381
381
382 $ hg escaped1
382 $ hg escaped1
383 test$test
383 test$test
384 $ hg escaped2
384 $ hg escaped2
385 HGFOO is BAR
385 HGFOO is BAR
386 $ hg escaped3 HGFOO
386 $ hg escaped3 HGFOO
387 HGFOO is BAR
387 HGFOO is BAR
388 $ hg escaped4 test
388 $ hg escaped4 test
389 $0 $@
389 $0 $@
390
390
391 abbreviated name, which matches against both shell alias and the
391 abbreviated name, which matches against both shell alias and the
392 command provided extension, should be aborted.
392 command provided extension, should be aborted.
393
393
394 $ cat >> .hg/hgrc <<EOF
394 $ cat >> .hg/hgrc <<EOF
395 > [extensions]
395 > [extensions]
396 > hgext.rebase =
396 > hgext.rebase =
397 > EOF
397 > EOF
398 #if windows
398 #if windows
399 $ cat >> .hg/hgrc <<EOF
399 $ cat >> .hg/hgrc <<EOF
400 > [alias]
400 > [alias]
401 > rebate = !echo this is %HG_ARGS%
401 > rebate = !echo this is %HG_ARGS%
402 > EOF
402 > EOF
403 #else
403 #else
404 $ cat >> .hg/hgrc <<EOF
404 $ cat >> .hg/hgrc <<EOF
405 > [alias]
405 > [alias]
406 > rebate = !echo this is \$HG_ARGS
406 > rebate = !echo this is \$HG_ARGS
407 > EOF
407 > EOF
408 #endif
408 #endif
409 $ hg reba
409 $ hg reba
410 hg: command 'reba' is ambiguous:
410 hg: command 'reba' is ambiguous:
411 rebase rebate
411 rebase rebate
412 [255]
412 [255]
413 $ hg rebat
413 $ hg rebat
414 this is rebate
414 this is rebate
415 $ hg rebat --foo-bar
415 $ hg rebat --foo-bar
416 this is rebate --foo-bar
416 this is rebate --foo-bar
417
417
418 invalid arguments
418 invalid arguments
419
419
420 $ hg rt foo
420 $ hg rt foo
421 hg rt: invalid arguments
421 hg rt: invalid arguments
422 hg rt
422 hg rt
423
423
424 alias for: hg root
424 alias for: hg root
425
425
426 (use "hg rt -h" to show more help)
426 (use "hg rt -h" to show more help)
427 [255]
427 [255]
428
428
429 invalid global arguments for normal commands, aliases, and shell aliases
429 invalid global arguments for normal commands, aliases, and shell aliases
430
430
431 $ hg --invalid root
431 $ hg --invalid root
432 hg: option --invalid not recognized
432 hg: option --invalid not recognized
433 Mercurial Distributed SCM
433 Mercurial Distributed SCM
434
434
435 basic commands:
435 basic commands:
436
436
437 add add the specified files on the next commit
437 add add the specified files on the next commit
438 annotate show changeset information by line for each file
438 annotate show changeset information by line for each file
439 clone make a copy of an existing repository
439 clone make a copy of an existing repository
440 commit commit the specified files or all outstanding changes
440 commit commit the specified files or all outstanding changes
441 diff diff repository (or selected files)
441 diff diff repository (or selected files)
442 export dump the header and diffs for one or more changesets
442 export dump the header and diffs for one or more changesets
443 forget forget the specified files on the next commit
443 forget forget the specified files on the next commit
444 init create a new repository in the given directory
444 init create a new repository in the given directory
445 log show revision history of entire repository or files
445 log show revision history of entire repository or files
446 merge merge another revision into working directory
446 merge merge another revision into working directory
447 pull pull changes from the specified source
447 pull pull changes from the specified source
448 push push changes to the specified destination
448 push push changes to the specified destination
449 remove remove the specified files on the next commit
449 remove remove the specified files on the next commit
450 serve start stand-alone webserver
450 serve start stand-alone webserver
451 status show changed files in the working directory
451 status show changed files in the working directory
452 summary summarize working directory state
452 summary summarize working directory state
453 update update working directory (or switch revisions)
453 update update working directory (or switch revisions)
454
454
455 (use "hg help" for the full list of commands or "hg -v" for details)
455 (use "hg help" for the full list of commands or "hg -v" for details)
456 [255]
456 [255]
457 $ hg --invalid mylog
457 $ hg --invalid mylog
458 hg: option --invalid not recognized
458 hg: option --invalid not recognized
459 Mercurial Distributed SCM
459 Mercurial Distributed SCM
460
460
461 basic commands:
461 basic commands:
462
462
463 add add the specified files on the next commit
463 add add the specified files on the next commit
464 annotate show changeset information by line for each file
464 annotate show changeset information by line for each file
465 clone make a copy of an existing repository
465 clone make a copy of an existing repository
466 commit commit the specified files or all outstanding changes
466 commit commit the specified files or all outstanding changes
467 diff diff repository (or selected files)
467 diff diff repository (or selected files)
468 export dump the header and diffs for one or more changesets
468 export dump the header and diffs for one or more changesets
469 forget forget the specified files on the next commit
469 forget forget the specified files on the next commit
470 init create a new repository in the given directory
470 init create a new repository in the given directory
471 log show revision history of entire repository or files
471 log show revision history of entire repository or files
472 merge merge another revision into working directory
472 merge merge another revision into working directory
473 pull pull changes from the specified source
473 pull pull changes from the specified source
474 push push changes to the specified destination
474 push push changes to the specified destination
475 remove remove the specified files on the next commit
475 remove remove the specified files on the next commit
476 serve start stand-alone webserver
476 serve start stand-alone webserver
477 status show changed files in the working directory
477 status show changed files in the working directory
478 summary summarize working directory state
478 summary summarize working directory state
479 update update working directory (or switch revisions)
479 update update working directory (or switch revisions)
480
480
481 (use "hg help" for the full list of commands or "hg -v" for details)
481 (use "hg help" for the full list of commands or "hg -v" for details)
482 [255]
482 [255]
483 $ hg --invalid blank
483 $ hg --invalid blank
484 hg: option --invalid not recognized
484 hg: option --invalid not recognized
485 Mercurial Distributed SCM
485 Mercurial Distributed SCM
486
486
487 basic commands:
487 basic commands:
488
488
489 add add the specified files on the next commit
489 add add the specified files on the next commit
490 annotate show changeset information by line for each file
490 annotate show changeset information by line for each file
491 clone make a copy of an existing repository
491 clone make a copy of an existing repository
492 commit commit the specified files or all outstanding changes
492 commit commit the specified files or all outstanding changes
493 diff diff repository (or selected files)
493 diff diff repository (or selected files)
494 export dump the header and diffs for one or more changesets
494 export dump the header and diffs for one or more changesets
495 forget forget the specified files on the next commit
495 forget forget the specified files on the next commit
496 init create a new repository in the given directory
496 init create a new repository in the given directory
497 log show revision history of entire repository or files
497 log show revision history of entire repository or files
498 merge merge another revision into working directory
498 merge merge another revision into working directory
499 pull pull changes from the specified source
499 pull pull changes from the specified source
500 push push changes to the specified destination
500 push push changes to the specified destination
501 remove remove the specified files on the next commit
501 remove remove the specified files on the next commit
502 serve start stand-alone webserver
502 serve start stand-alone webserver
503 status show changed files in the working directory
503 status show changed files in the working directory
504 summary summarize working directory state
504 summary summarize working directory state
505 update update working directory (or switch revisions)
505 update update working directory (or switch revisions)
506
506
507 (use "hg help" for the full list of commands or "hg -v" for details)
507 (use "hg help" for the full list of commands or "hg -v" for details)
508 [255]
508 [255]
509
509
510 This should show id:
510 This should show id:
511
511
512 $ hg --config alias.log='id' log
512 $ hg --config alias.log='id' log
513 000000000000 tip
513 000000000000 tip
514
514
515 This shouldn't:
515 This shouldn't:
516
516
517 $ hg --config alias.log='id' history
517 $ hg --config alias.log='id' history
518
518
519 $ cd ../..
519 $ cd ../..
520
520
521 return code of command and shell aliases:
521 return code of command and shell aliases:
522
522
523 $ hg mycommit -R alias
523 $ hg mycommit -R alias
524 nothing changed
524 nothing changed
525 [1]
525 [1]
526 $ hg exit1
526 $ hg exit1
527 [1]
527 [1]
528
529 #if no-outer-repo
530 $ hg root
531 abort: no repository found in '$TESTTMP' (.hg not found)!
532 [255]
533 $ hg --config alias.hgroot='!hg root' hgroot
534 abort: no repository found in '$TESTTMP' (.hg not found)!
535 [255]
536 #endif
General Comments 0
You need to be logged in to leave comments. Login now