annotate tests/test-globalopts @ 2319:04a18aaaca25

test-globalopts: make sed expression better.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Thu, 18 May 2006 23:02:24 -0700
parents 3dc6f2501dbc
children 049f930f18c1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2293
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
1 #!/bin/sh
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
2
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
3 hg init a
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
4 cd a
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
5 echo a > a
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
6 hg ci -A -d'1 0' -m a
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
7
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
8 cd ..
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
9
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
10 hg init b
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
11 cd b
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
12 echo b > b
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
13 hg ci -A -d'1 0' -m b
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
14
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
15 cd ..
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
16
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
17 hg clone a c
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
18 cd c
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
19 hg pull -f ../b
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
20 HGMERGE=merge hg merge
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
21
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
22 cd ..
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
23
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
24 echo %% -R/--repository
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
25 hg -R a tip
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
26 hg --repository b tip
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
27
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
28 echo %% abbrev of long option
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
29 hg --repo c tip
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
30
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
31 echo %% --cwd
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
32 hg --cwd a parents
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
33
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
34 echo %% -y/--noninteractive - just be sure it is parsed
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
35 hg --cwd a tip -q --noninteractive
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
36 hg --cwd a tip -q -y
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
37
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
38 echo %% -q/--quiet
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
39 hg -R a -q tip
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
40 hg -R b -q tip
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
41 hg -R c --quiet parents
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
42
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
43 echo %% -v/--verbose
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
44 hg --cwd c head -v
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
45 hg --cwd b tip --verbose
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
46
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
47 echo %% --config
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
48 hg --cwd c --config paths.quuxfoo=bar paths | grep -q quuxfoo && echo quuxfoo
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
49 hg --cwd c --config '' tip -q
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
50 hg --cwd c --config a.b tip -q
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
51 hg --cwd c --config a tip -q
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
52 hg --cwd c --config a.= tip -q
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
53 hg --cwd c --config .b= tip -q
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
54
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
55 echo %% --debug
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
56 hg --cwd c log --debug
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
57
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
58 echo %% --traceback
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
59 hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
60
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
61 echo %% --time
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
62 hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
63
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
64 echo %% --version
2319
04a18aaaca25 test-globalopts: make sed expression better.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2293
diff changeset
65 hg --version -q | sed 's/version \([a-f0-9+]*\|unknown\)/version xxx/'
2293
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
66
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
67 echo %% -h/--help
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
68 hg -h
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
69 hg --help
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
70
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
71 echo %% not tested: --debugger
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
72