tests/test-alias.t
author Christian Ebert <blacktrash@gmx.net>
Wed, 01 Dec 2010 10:51:49 +0100
branchstable
changeset 13069 6aff4f144ad3
parent 12932 ab93029ab622
child 13434 b5cc838dd999
permissions -rw-r--r--
keyword: copy: when copied source is a symlink, follow it 1) hg cp symlink copy -> copy is a symlink. 2) cp symlink copy; hg cp -A symlink copy -> copy is a regular file. In the second case we have to follow the symlink to its target to find out whether we have to unexpand keywords in the copy. Add test covering the case where the copied link's target is ignored by keyword but has content which would match the regex for expanded keywords to check whether we indeed leave the destination alone.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     1
  $ cat >> $HGRCPATH <<EOF
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
     2
  > [extensions]
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
     3
  > graphlog=
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
     4
  > 
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     5
  > [alias]
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     6
  > myinit = init
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     7
  > cleanstatus = status -c
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     8
  > unknown = bargle
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     9
  > ambiguous = s
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    10
  > recursive = recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    11
  > nodefinition =
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    12
  > no--cwd = status --cwd elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    13
  > no-R = status -R elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    14
  > no--repo = status --repo elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    15
  > no--repository = status --repository elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    16
  > mylog = log
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    17
  > lognull = log -r null
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    18
  > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    19
  > dln = lognull --debug
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    20
  > nousage = rollback
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    21
  > put = export -r 0 -o "\$FOO/%R.diff"
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    22
  > blank = !echo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    23
  > self = !echo '\$0'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    24
  > echo = !echo '\$@'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    25
  > echo1 = !echo '\$1'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    26
  > echo2 = !echo '\$2'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    27
  > echo13 = !echo '\$1' '\$3'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
    28
  > count = !hg log -r '\$@' --template='.' | wc -c | sed -e 's/ //g'
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
    29
  > mcount = !hg log \$@ --template='.' | wc -c | sed -e 's/ //g'
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    30
  > rt = root
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
    31
  > tglog = glog --template "{rev}:{node|short}: '{desc}' {branches}\n"
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    32
  > idalias = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    33
  > idaliaslong = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    34
  > idaliasshell = !echo test
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    35
  > parentsshell1 = !echo one
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    36
  > parentsshell2 = !echo two
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    37
  > 
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    38
  > [defaults]
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    39
  > mylog = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    40
  > lognull = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    41
  > log = -v
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    42
  > EOF
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    43
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    44
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    45
basic
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    46
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    47
  $ hg myinit alias
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    48
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    49
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    50
unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    51
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    52
  $ hg unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    53
  alias 'unknown' resolves to unknown command 'bargle'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    54
  $ hg help unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    55
  alias 'unknown' resolves to unknown command 'bargle'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    56
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    57
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    58
ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    59
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    60
  $ hg ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    61
  alias 'ambiguous' resolves to ambiguous command 's'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    62
  $ hg help ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    63
  alias 'ambiguous' resolves to ambiguous command 's'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    64
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    65
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    66
recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    67
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    68
  $ hg recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    69
  alias 'recursive' resolves to unknown command 'recursive'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    70
  $ hg help recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    71
  alias 'recursive' resolves to unknown command 'recursive'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    72
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    73
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    74
no definition
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
    75
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    76
  $ hg nodef
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    77
  no definition for alias 'nodefinition'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    78
  $ hg help nodef
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    79
  no definition for alias 'nodefinition'
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    80
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    81
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    82
invalid options
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    83
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    84
  $ hg no--cwd
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    85
  error in definition for alias 'no--cwd': --cwd may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    86
  $ hg help no--cwd
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    87
  error in definition for alias 'no--cwd': --cwd may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    88
  $ hg no-R
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    89
  error in definition for alias 'no-R': -R may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    90
  $ hg help no-R
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    91
  error in definition for alias 'no-R': -R may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    92
  $ hg no--repo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    93
  error in definition for alias 'no--repo': --repo may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    94
  $ hg help no--repo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    95
  error in definition for alias 'no--repo': --repo may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    96
  $ hg no--repository
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    97
  error in definition for alias 'no--repository': --repository may only be given on the command line
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    98
  $ hg help no--repository
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    99
  error in definition for alias 'no--repository': --repository may only be given on the command line
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   100
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   101
  $ cd alias
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   102
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   103
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   104
no usage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   105
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   106
  $ hg nousage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   107
  no rollback information available
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   108
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   109
  $ echo foo > foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   110
  $ hg ci -Amfoo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   111
  adding foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   112
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   113
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   114
with opts
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   115
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   116
  $ hg cleanst
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   117
  C foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   118
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   119
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   120
with opts and whitespace
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   121
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   122
  $ hg shortlog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   123
  0 e63c23eaa88a | 1970-01-01 00:00 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   124
11695
ee8f36a6c766 alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11681
diff changeset
   125
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   126
interaction with defaults
9993
8bce1e0d2801 alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8655
diff changeset
   127
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   128
  $ hg mylog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   129
  0:e63c23eaa88a
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   130
  $ hg lognull
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   131
  -1:000000000000
9993
8bce1e0d2801 alias: do not crash when aliased command has no usage help text
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 8655
diff changeset
   132
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   133
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   134
properly recursive
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   135
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   136
  $ hg dln
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   137
  changeset:   -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   138
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   139
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   140
  manifest:    -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   141
  user:        
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   142
  date:        Thu Jan 01 00:00:00 1970 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   143
  extra:       branch=default
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   144
  
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
   145
8519
5fbee915ea5d alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8477
diff changeset
   146
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   147
path expanding
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   148
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   149
  $ FOO=`pwd` hg put
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   150
  $ cat 0.diff
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   151
  # HG changeset patch
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   152
  # User test
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   153
  # Date 0 0
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   154
  # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   155
  # Parent  0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   156
  foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   157
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   158
  diff -r 000000000000 -r e63c23eaa88a foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   159
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   160
  +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   161
  @@ -0,0 +1,1 @@
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   162
  +foo
10793
16df09a54113 expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10021
diff changeset
   163
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   164
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   165
simple shell aliases
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   166
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   167
  $ hg blank
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   168
  
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   169
  $ hg blank foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   170
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   171
  $ hg self
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   172
  self
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   173
  $ hg echo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   174
  
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   175
  $ hg echo foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   176
  foo
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   177
  $ hg echo 'test $2' foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   178
  test $2 foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   179
  $ hg echo1 foo bar baz
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   180
  foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   181
  $ hg echo2 foo bar baz
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   182
  bar
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   183
  $ hg echo13 foo bar baz test
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   184
  foo baz
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   185
  $ hg echo2 foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   186
  
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   187
  $ echo bar > bar
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   188
  $ hg ci -qA -m bar
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   189
  $ hg count .
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   190
  1
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   191
  $ hg count 'branch(default)'
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   192
  2
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   193
  $ hg mcount -r '"branch(default)"'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   194
  2
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   195
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   196
  $ hg tglog
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   197
  @  1:7e7f92de180e: 'bar'
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   198
  |
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   199
  o  0:e63c23eaa88a: 'foo'
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   200
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   201
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   202
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   203
shadowing
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   204
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   205
  $ hg i
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   206
  hg: command 'i' is ambiguous:
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   207
      idalias idaliaslong idaliasshell identify import incoming init
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   208
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   209
  $ hg id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   210
  7e7f92de180e tip
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   211
  $ hg ida
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   212
  hg: command 'ida' is ambiguous:
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   213
      idalias idaliaslong idaliasshell
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   214
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   215
  $ hg idalias
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   216
  7e7f92de180e tip
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   217
  $ hg idaliasl
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   218
  7e7f92de180e tip
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   219
  $ hg idaliass
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   220
  test
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   221
  $ hg parentsshell
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   222
  hg: command 'parentsshell' is ambiguous:
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   223
      parentsshell1 parentsshell2
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   224
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   225
  $ hg parentsshell1
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   226
  one
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   227
  $ hg parentsshell2
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   228
  two
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   229
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   230
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   231
shell aliases with global options
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   232
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   233
  $ hg init sub
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   234
  $ cd sub
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   235
  $ hg count 'branch(default)'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   236
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   237
  $ hg -v count 'branch(default)'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   238
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   239
  $ hg -R .. count 'branch(default)'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   240
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   241
  $ hg --cwd .. count 'branch(default)'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   242
  2
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   243
  $ hg echo --cwd ..
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   244
  --cwd ..
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   245
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   246
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   247
repo specific shell aliases
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   248
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   249
  $ cat >> .hg/hgrc <<EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   250
  > [alias]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   251
  > subalias = !echo sub \$@
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   252
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   253
  $ cat >> ../.hg/hgrc <<EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   254
  > [alias]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   255
  > mainalias = !echo main \$@
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   256
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   257
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   258
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   259
shell alias defined in current repo
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   260
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   261
  $ hg subalias
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   262
  sub
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   263
  $ hg --cwd .. subalias > /dev/null
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   264
  hg: unknown command 'subalias'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   265
  [255]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   266
  $ hg -R .. subalias > /dev/null
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   267
  hg: unknown command 'subalias'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   268
  [255]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   269
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   270
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   271
shell alias defined in other repo
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   272
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   273
  $ hg mainalias > /dev/null
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   274
  hg: unknown command 'mainalias'
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   275
  [255]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   276
  $ hg -R .. mainalias
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   277
  main
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   278
  $ hg --cwd .. mainalias
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   279
  main
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   280
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   281
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   282
invalid arguments
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   283
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   284
  $ hg rt foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   285
  hg rt: invalid arguments
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   286
  hg rt 
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   287
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   288
  alias for: hg root
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   289
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   290
  print the root (top) of the current working directory
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   291
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   292
      Print the root directory of the current repository.
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   293
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   294
      Returns 0 on success.
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   295
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   296
  use "hg -v help rt" to show global options
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11989
diff changeset
   297
  [255]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   298
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   299
invalid global arguments for normal commands, aliases, and shell aliases
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   300
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   301
  $ hg --invalid root
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   302
  hg: option --invalid not recognized
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   303
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   304
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   305
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   306
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   307
   add        add the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   308
   annotate   show changeset information by line for each file
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   309
   clone      make a copy of an existing repository
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   310
   commit     commit the specified files or all outstanding changes
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   311
   diff       diff repository (or selected files)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   312
   export     dump the header and diffs for one or more changesets
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   313
   forget     forget the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   314
   init       create a new repository in the given directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   315
   log        show revision history of entire repository or files
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   316
   merge      merge working directory with another revision
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   317
   pull       pull changes from the specified source
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   318
   push       push changes to the specified destination
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   319
   remove     remove the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   320
   serve      start stand-alone webserver
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   321
   status     show changed files in the working directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   322
   summary    summarize working directory state
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   323
   update     update working directory (or switch revisions)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   324
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   325
  use "hg help" for the full list of commands or "hg -v" for details
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   326
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   327
  $ hg --invalid mylog
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   328
  hg: option --invalid not recognized
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   329
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   330
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   331
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   332
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   333
   add        add the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   334
   annotate   show changeset information by line for each file
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   335
   clone      make a copy of an existing repository
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   336
   commit     commit the specified files or all outstanding changes
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   337
   diff       diff repository (or selected files)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   338
   export     dump the header and diffs for one or more changesets
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   339
   forget     forget the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   340
   init       create a new repository in the given directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   341
   log        show revision history of entire repository or files
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   342
   merge      merge working directory with another revision
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   343
   pull       pull changes from the specified source
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   344
   push       push changes to the specified destination
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   345
   remove     remove the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   346
   serve      start stand-alone webserver
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   347
   status     show changed files in the working directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   348
   summary    summarize working directory state
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   349
   update     update working directory (or switch revisions)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   350
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   351
  use "hg help" for the full list of commands or "hg -v" for details
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   352
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   353
  $ hg --invalid blank
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   354
  hg: option --invalid not recognized
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   355
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   356
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   357
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   358
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   359
   add        add the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   360
   annotate   show changeset information by line for each file
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   361
   clone      make a copy of an existing repository
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   362
   commit     commit the specified files or all outstanding changes
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   363
   diff       diff repository (or selected files)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   364
   export     dump the header and diffs for one or more changesets
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   365
   forget     forget the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   366
   init       create a new repository in the given directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   367
   log        show revision history of entire repository or files
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   368
   merge      merge working directory with another revision
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   369
   pull       pull changes from the specified source
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   370
   push       push changes to the specified destination
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   371
   remove     remove the specified files on the next commit
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   372
   serve      start stand-alone webserver
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   373
   status     show changed files in the working directory
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   374
   summary    summarize working directory state
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   375
   update     update working directory (or switch revisions)
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   376
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   377
  use "hg help" for the full list of commands or "hg -v" for details
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   378
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   379