tests/test-globalopts
changeset 12194 9e40ea08c2ab
parent 12193 927e1a677267
child 12195 ee41be2bbf5a
equal deleted inserted replaced
12193:927e1a677267 12194:9e40ea08c2ab
     1 #!/bin/sh
       
     2 
       
     3 "$TESTDIR/hghave" no-outer-repo || exit 80
       
     4 
       
     5 hg init a
       
     6 cd a
       
     7 echo a > a
       
     8 hg ci -A -d'1 0' -m a
       
     9 
       
    10 cd ..
       
    11 
       
    12 hg init b
       
    13 cd b
       
    14 echo b > b
       
    15 hg ci -A -d'1 0' -m b
       
    16 
       
    17 cd ..
       
    18 
       
    19 hg clone a c
       
    20 cd c
       
    21 hg pull -f ../b
       
    22 hg merge
       
    23 
       
    24 cd ..
       
    25 
       
    26 echo %% -R/--repository
       
    27 hg -R a tip
       
    28 hg --repository b tip
       
    29 
       
    30 echo %% implicit -R
       
    31 hg ann a/a
       
    32 hg ann a/a a/a
       
    33 hg ann a/a b/b
       
    34 hg -R b ann a/a
       
    35 hg log
       
    36 
       
    37 echo %% abbrev of long option
       
    38 hg --repo c tip
       
    39 
       
    40 echo "%% earlygetopt with duplicate options (36d23de02da1)"
       
    41 hg --cwd a --cwd b --cwd c tip
       
    42 hg --repo c --repository b -R a tip
       
    43 
       
    44 echo "%% earlygetopt short option without following space"
       
    45 hg -q -Rb tip
       
    46 
       
    47 echo "%% earlygetopt with illegal abbreviations"
       
    48 hg --confi "foo.bar=baz"
       
    49 hg --cw a tip
       
    50 hg --rep a tip
       
    51 hg --repositor a tip
       
    52 hg -qR a tip
       
    53 hg -qRa tip
       
    54 
       
    55 echo %% --cwd
       
    56 hg --cwd a parents
       
    57 
       
    58 echo %% -y/--noninteractive - just be sure it is parsed
       
    59 hg --cwd a tip -q --noninteractive
       
    60 hg --cwd a tip -q -y
       
    61 
       
    62 echo %% -q/--quiet
       
    63 hg -R a -q tip
       
    64 hg -R b -q tip
       
    65 hg -R c --quiet parents
       
    66 
       
    67 echo %% -v/--verbose
       
    68 hg --cwd c head -v
       
    69 hg --cwd b tip --verbose
       
    70 
       
    71 echo %% --config
       
    72 hg --cwd c --config paths.quuxfoo=bar paths | grep quuxfoo > /dev/null && echo quuxfoo
       
    73 hg --cwd c --config '' tip -q
       
    74 hg --cwd c --config a.b tip -q
       
    75 hg --cwd c --config a tip -q
       
    76 hg --cwd c --config a.= tip -q
       
    77 hg --cwd c --config .b= tip -q
       
    78 
       
    79 echo %% --debug
       
    80 hg --cwd c log --debug
       
    81 
       
    82 echo %% --traceback
       
    83 hg --cwd c --config x --traceback tip 2>&1 | grep -i 'traceback'
       
    84 
       
    85 echo %% --time
       
    86 hg --cwd a --time tip 2>&1 | grep '^Time:' | sed 's/[0-9][0-9]*/x/g'
       
    87 
       
    88 echo %% --version
       
    89 hg --version -q | sed 's/version [^)]*/version xxx/'
       
    90 
       
    91 echo %% -h/--help
       
    92 hg -h
       
    93 hg --help
       
    94 
       
    95 echo %% not tested: --debugger
       
    96