tests/test-globalopts
author Thomas Arendsen Hein <thomas@intevation.de>
Tue, 26 Jun 2007 18:39:28 +0200
changeset 4728 7bb5bcb089e3
parent 4361 46280c004f22
child 4732 b0520e3903fe
permissions -rwxr-xr-x
Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
4361
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 2831
diff changeset
    20
hg merge
2293
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
4728
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    31
echo "%% earlygetopt with duplicate options (36d23de02da1)"
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    32
hg --cwd a --cwd b --cwd c tip
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    33
hg --repo c --repository b -R a tip
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    34
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    35
echo "%% earlygetopt short option without spaces (79cc512a34ed)"
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    36
hg -qR a tip
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    37
hg -q -Rb tip
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    38
hg -qRc tip
7bb5bcb089e3 Added test for earlygetopt fixes (36d23de02da1 and 79cc512a34ed)
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4361
diff changeset
    39
2293
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    40
echo %% --cwd
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    41
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
    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 %% -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
    44
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
    45
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
    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 %% -q/--quiet
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    48
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
    49
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
    50
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
    51
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    52
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
    53
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
    54
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
    55
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    56
echo %% --config
2831
0b9ac7dfcf56 Fix some tests for portability.
Danek Duvall <danek.duvall@sun.com>
parents: 2528
diff changeset
    57
hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
2293
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    58
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
    59
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
    60
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
    61
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
    62
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
    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 %% --debug
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    65
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
    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 %% --traceback
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    68
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
    69
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    70
echo %% --time
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    71
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
    72
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    73
echo %% --version
2528
049f930f18c1 Workaround to work with less sophisticated sed versions.
Sascha Wilde <wilde@sha-bang.de>
parents: 2319
diff changeset
    74
hg --version -q | sed 's/version [^)]*/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
    75
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    76
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
    77
hg -h
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    78
hg --help
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    79
3dc6f2501dbc add --config global option. allows to set hgrc option on command line.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
diff changeset
    80
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
    81