tests/test-alias.t
author Mads Kiilerich <madski@unity3d.com>
Fri, 28 Nov 2014 03:09:06 +0100
changeset 23442 a5c94ea3b8af
parent 23400 3bd577a3283e
child 23934 975c4fc4a512
permissions -rw-r--r--
mq: smarter handling of plain headers 6333412245ec and 5ccced6eab0b fixed issue4453 with a simple insertplainheader function that fixed the regression but didn't make the implementation more stable. Now we introduce plain header handling similar to how we handle hg patches. The whole header is scanned for fields to update while determining the best position for inserting the field if it is missing. It also makes sure there is an empty line between headers and body.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13434
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
     1
  $ HGFOO=BAR; export HGFOO
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     2
  $ cat >> $HGRCPATH <<EOF
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     3
  > [alias]
15233
81c97964d123 alias: don't shadow commands that we only partially matched (issue2993) (BC)
Augie Fackler <durin42@gmail.com>
parents: 15203
diff changeset
     4
  > # should clobber ci but not commit (issue2993)
81c97964d123 alias: don't shadow commands that we only partially matched (issue2993) (BC)
Augie Fackler <durin42@gmail.com>
parents: 15203
diff changeset
     5
  > ci = version
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     6
  > myinit = init
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
     7
  > mycommit = commit
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
     8
  > optionalrepo = showconfig alias.myinit
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
     9
  > cleanstatus = status -c
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    10
  > unknown = bargle
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    11
  > ambiguous = s
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    12
  > recursive = recursive
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    13
  > disabled = email
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    14
  > nodefinition =
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
    15
  > noclosingquotation = '
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    16
  > no--cwd = status --cwd elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    17
  > no-R = status -R elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    18
  > no--repo = status --repo elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    19
  > no--repository = status --repository elsewhere
18693
633cd0c46e6a dispatch: also a separate warning message on aliases with --config
Simon Heimberg <simohe@besonet.ch>
parents: 18648
diff changeset
    20
  > no--config = status --config a.config=1
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    21
  > mylog = log
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    22
  > lognull = log -r null
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    23
  > shortlog = log --template '{rev} {node|short} | {date|isodate}\n'
14265
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
    24
  > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    25
  > dln = lognull --debug
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    26
  > nousage = rollback
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    27
  > put = export -r 0 -o "\$FOO/%R.diff"
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    28
  > blank = !printf '\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    29
  > self = !printf '\$0\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    30
  > echoall = !printf '\$@\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    31
  > echo1 = !printf '\$1\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    32
  > echo2 = !printf '\$2\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    33
  > echo13 = !printf '\$1 \$3\n'
22158
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
    34
  > echotokens = !printf "%s\n" "\$@"
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    35
  > count = !hg log -r "\$@" --template=. | wc -c | sed -e 's/ //g'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    36
  > 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
    37
  > rt = root
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 18991
diff changeset
    38
  > tglog = log -G --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
    39
  > idalias = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    40
  > idaliaslong = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    41
  > 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
    42
  > 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
    43
  > parentsshell2 = !echo two
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    44
  > escaped1 = !printf 'test\$\$test\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    45
  > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    46
  > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    47
  > escaped4 = !printf '\$\$0 \$\$@\n'
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
    48
  > exit1 = !sh -c 'exit 1'
11814
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
  > [defaults]
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    51
  > mylog = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    52
  > lognull = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    53
  > log = -v
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    54
  > EOF
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    55
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    56
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    57
basic
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    58
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    59
  $ hg myinit alias
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    60
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    61
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    62
unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    63
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    64
  $ hg unknown
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
    65
  abort: alias 'unknown' resolves to unknown command 'bargle'
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
    66
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    67
  $ hg help unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    68
  alias 'unknown' resolves to unknown command 'bargle'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    69
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    70
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    71
ambiguous
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
  $ hg ambiguous
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
    74
  abort: alias 'ambiguous' resolves to ambiguous command 's'
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
    75
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    76
  $ hg help ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    77
  alias 'ambiguous' resolves to ambiguous command 's'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    78
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    79
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    80
recursive
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
  $ hg recursive
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
    83
  abort: alias 'recursive' resolves to unknown command 'recursive'
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
    84
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    85
  $ hg help recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    86
  alias 'recursive' resolves to unknown command 'recursive'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    87
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    88
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    89
disabled
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    90
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    91
  $ hg disabled
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
    92
  abort: alias 'disabled' resolves to unknown command 'email'
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
    93
  ('email' is provided by 'patchbomb' extension)
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    94
  [255]
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    95
  $ hg help disabled
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    96
  alias 'disabled' resolves to unknown command 'email'
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
    97
  
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    98
  'email' is provided by the following extension:
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    99
  
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   100
      patchbomb     command to send changesets as (a series of) patch emails
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   101
  
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   102
  (use "hg help extensions" for information on enabling extensions)
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   103
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   104
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   105
no definition
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
   106
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   107
  $ hg nodef
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   108
  abort: no definition for alias 'nodefinition'
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   109
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   110
  $ hg help nodef
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   111
  no definition for alias 'nodefinition'
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   112
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   113
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   114
no closing quotation
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   115
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   116
  $ hg noclosing
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   117
  abort: error in definition for alias 'noclosingquotation': No closing quotation
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   118
  [255]
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   119
  $ hg help noclosing
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   120
  error in definition for alias 'noclosingquotation': No closing quotation
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   121
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   122
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   123
invalid options
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   124
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   125
  $ hg no--cwd
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   126
  abort: error in definition for alias 'no--cwd': --cwd may only be given on the command line
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   127
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   128
  $ hg help no--cwd
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   129
  error in definition for alias 'no--cwd': --cwd may only be given on the
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   130
  command line
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   131
  $ hg no-R
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   132
  abort: error in definition for alias 'no-R': -R may only be given on the command line
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   133
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   134
  $ hg help no-R
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   135
  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
   136
  $ hg no--repo
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   137
  abort: error in definition for alias 'no--repo': --repo may only be given on the command line
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   138
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   139
  $ hg help no--repo
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   140
  error in definition for alias 'no--repo': --repo may only be given on the
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   141
  command line
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   142
  $ hg no--repository
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   143
  abort: error in definition for alias 'no--repository': --repository may only be given on the command line
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   144
  [255]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   145
  $ hg help no--repository
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   146
  error in definition for alias 'no--repository': --repository may only be given
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   147
  on the command line
18693
633cd0c46e6a dispatch: also a separate warning message on aliases with --config
Simon Heimberg <simohe@besonet.ch>
parents: 18648
diff changeset
   148
  $ hg no--config
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   149
  abort: error in definition for alias 'no--config': --config may only be given on the command line
21572
6c9b7712ac69 alias: change return code of bad definition to 255
Yuya Nishihara <yuya@tcha.org>
parents: 21569
diff changeset
   150
  [255]
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   151
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   152
optional repository
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   153
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16965
diff changeset
   154
#if no-outer-repo
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   155
  $ hg optionalrepo
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   156
  init
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16965
diff changeset
   157
#endif
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   158
  $ cd alias
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   159
  $ cat > .hg/hgrc <<EOF
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   160
  > [alias]
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   161
  > myinit = init -q
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   162
  > EOF
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   163
  $ hg optionalrepo
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   164
  init -q
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   165
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   166
no usage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   167
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   168
  $ hg nousage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   169
  no rollback information available
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   170
  [1]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   171
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   172
  $ echo foo > foo
15233
81c97964d123 alias: don't shadow commands that we only partially matched (issue2993) (BC)
Augie Fackler <durin42@gmail.com>
parents: 15203
diff changeset
   173
  $ hg commit -Amfoo
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   174
  adding foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   175
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   176
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   177
with opts
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   178
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   179
  $ hg cleanst
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   180
  C foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   181
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   182
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   183
with opts and whitespace
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   184
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   185
  $ hg shortlog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   186
  0 e63c23eaa88a | 1970-01-01 00:00 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   187
14265
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   188
positional arguments
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   189
16294
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   190
  $ hg positional
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   191
  abort: too few arguments for command alias
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   192
  [255]
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   193
  $ hg positional a
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   194
  abort: too few arguments for command alias
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   195
  [255]
14265
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   196
  $ hg positional 'node|short' rev
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   197
  0 e63c23eaa88a | 1970-01-01 00:00 +0000
11695
ee8f36a6c766 alias: improved diagnostic when arguments include --cwd, etc.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents: 11681
diff changeset
   198
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   199
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
   200
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   201
  $ hg mylog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   202
  0:e63c23eaa88a
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   203
  $ hg lognull
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   204
  -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
   205
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   206
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   207
properly recursive
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   208
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   209
  $ hg dln
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   210
  changeset:   -1:0000000000000000000000000000000000000000
22765
55dcc7fb731c log: do not hide the public phase in debug mode (BC)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22378
diff changeset
   211
  phase:       public
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   212
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   213
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   214
  manifest:    -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   215
  user:        
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   216
  date:        Thu Jan 01 00:00:00 1970 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   217
  extra:       branch=default
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   218
  
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
   219
8519
5fbee915ea5d alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8477
diff changeset
   220
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   221
path expanding
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   222
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   223
  $ FOO=`pwd` hg put
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   224
  $ cat 0.diff
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   225
  # HG changeset patch
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   226
  # User test
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   227
  # Date 0 0
18648
76b69cccb07a export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents: 17981
diff changeset
   228
  #      Thu Jan 01 00:00:00 1970 +0000
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   229
  # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   230
  # Parent  0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   231
  foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   232
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   233
  diff -r 000000000000 -r e63c23eaa88a foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   234
  --- /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
   235
  +++ 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
   236
  @@ -0,0 +1,1 @@
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   237
  +foo
10793
16df09a54113 expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10021
diff changeset
   238
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   239
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   240
simple shell aliases
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   241
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   242
  $ hg blank
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   243
  
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   244
  $ hg blank foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   245
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   246
  $ 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
   247
  self
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   248
  $ hg echoall
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   249
  
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   250
  $ hg echoall foo
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   251
  foo
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   252
  $ hg echoall 'test $2' foo
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   253
  test $2 foo
22157
bd45d92883f9 test-alias: add some tests to ensure we aren't double-substituting
Siddharth Agarwal <sid0@fb.com>
parents: 22118
diff changeset
   254
  $ hg echoall 'test $@' foo '$@'
bd45d92883f9 test-alias: add some tests to ensure we aren't double-substituting
Siddharth Agarwal <sid0@fb.com>
parents: 22118
diff changeset
   255
  test $@ foo $@
bd45d92883f9 test-alias: add some tests to ensure we aren't double-substituting
Siddharth Agarwal <sid0@fb.com>
parents: 22118
diff changeset
   256
  $ hg echoall 'test "$@"' foo '"$@"'
bd45d92883f9 test-alias: add some tests to ensure we aren't double-substituting
Siddharth Agarwal <sid0@fb.com>
parents: 22118
diff changeset
   257
  test "$@" foo "$@"
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   258
  $ 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
   259
  foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   260
  $ 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
   261
  bar
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   262
  $ 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
   263
  foo baz
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   264
  $ hg echo2 foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   265
  
22158
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   266
  $ hg echotokens
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   267
  
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   268
  $ hg echotokens foo 'bar $1 baz'
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   269
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   270
  bar $1 baz
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   271
  $ hg echotokens 'test $2' foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   272
  test $2
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   273
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   274
  $ hg echotokens 'test $@' foo '$@'
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   275
  test $@
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   276
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   277
  $@
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   278
  $ hg echotokens 'test "$@"' foo '"$@"'
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   279
  test "$@"
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   280
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   281
  "$@"
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   282
  $ echo bar > bar
15233
81c97964d123 alias: don't shadow commands that we only partially matched (issue2993) (BC)
Augie Fackler <durin42@gmail.com>
parents: 15203
diff changeset
   283
  $ hg commit -qA -m bar
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   284
  $ hg count .
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   285
  1
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   286
  $ 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
   287
  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
   288
  $ 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
   289
  2
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   290
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   291
  $ hg tglog
18648
76b69cccb07a export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents: 17981
diff changeset
   292
  @  1:042423737847: 'bar'
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   293
  |
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   294
  o  0:e63c23eaa88a: 'foo'
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   295
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   296
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   297
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   298
shadowing
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   299
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   300
  $ hg i
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   301
  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
   302
      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
   303
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   304
  $ hg id
18648
76b69cccb07a export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents: 17981
diff changeset
   305
  042423737847 tip
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   306
  $ hg ida
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   307
  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
   308
      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
   309
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   310
  $ hg idalias
18648
76b69cccb07a export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents: 17981
diff changeset
   311
  042423737847 tip
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   312
  $ hg idaliasl
18648
76b69cccb07a export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents: 17981
diff changeset
   313
  042423737847 tip
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   314
  $ hg idaliass
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   315
  test
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   316
  $ hg parentsshell
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   317
  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
   318
      parentsshell1 parentsshell2
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   319
  [255]
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   320
  $ hg parentsshell1
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   321
  one
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   322
  $ hg parentsshell2
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   323
  two
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   324
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   325
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   326
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
   327
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   328
  $ 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
   329
  $ 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
   330
  $ hg count 'branch(default)'
18991
c1af1fb314bc log: fix behavior with empty repositories (issue3497)
Alexander Plavin <me@aplavin.ru>
parents: 18693
diff changeset
   331
  abort: unknown revision 'default'!
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   332
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   333
  $ hg -v count 'branch(default)'
18991
c1af1fb314bc log: fix behavior with empty repositories (issue3497)
Alexander Plavin <me@aplavin.ru>
parents: 18693
diff changeset
   334
  abort: unknown revision 'default'!
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   335
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   336
  $ hg -R .. count 'branch(default)'
18991
c1af1fb314bc log: fix behavior with empty repositories (issue3497)
Alexander Plavin <me@aplavin.ru>
parents: 18693
diff changeset
   337
  abort: unknown revision 'default'!
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   338
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   339
  $ 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
   340
  2
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   341
  $ hg echoall --cwd ..
14886
9a3831d64ae2 dispatch: move shell alias handling after early arg handling
Matt Mackall <mpm@selenic.com>
parents: 14265
diff changeset
   342
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   343
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   344
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   345
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
   346
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   347
  $ 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
   348
  > [alias]
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   349
  > subalias = !echo sub
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   350
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   351
  $ 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
   352
  > [alias]
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   353
  > mainalias = !echo main
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   354
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   355
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   356
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   357
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
   358
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   359
  $ 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
   360
  sub
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   361
  $ 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
   362
  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
   363
  [255]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   364
  $ hg -R .. subalias > /dev/null
14890
28abca72c46c alias: fix up test results
Matt Mackall <mpm@selenic.com>
parents: 14886
diff changeset
   365
  hg: unknown command 'subalias'
28abca72c46c alias: fix up test results
Matt Mackall <mpm@selenic.com>
parents: 14886
diff changeset
   366
  [255]
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   367
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   368
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   369
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
   370
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   371
  $ 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
   372
  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
   373
  [255]
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   374
  $ 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
   375
  main
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   376
  $ 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
   377
  main
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   378
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   379
13434
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   380
shell aliases with escaped $ chars
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   381
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   382
  $ hg escaped1
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   383
  test$test
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   384
  $ hg escaped2
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   385
  HGFOO is BAR
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   386
  $ hg escaped3 HGFOO
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   387
  HGFOO is BAR
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   388
  $ hg escaped4 test
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   389
  $0 $@
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   390
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   391
abbreviated name, which matches against both shell alias and the
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   392
command provided extension, should be aborted.
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   393
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   394
  $ cat >> .hg/hgrc <<EOF
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   395
  > [extensions]
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   396
  > hgext.rebase =
23093
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   397
  > EOF
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   398
#if windows
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   399
  $ cat >> .hg/hgrc <<EOF
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   400
  > [alias]
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   401
  > rebate = !echo this is %HG_ARGS%
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   402
  > EOF
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   403
#else
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   404
  $ cat >> .hg/hgrc <<EOF
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   405
  > [alias]
22377
f98abe3146b2 dispatch: check shell alias again after loading extensions (issue4355)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21572
diff changeset
   406
  > rebate = !echo this is \$HG_ARGS
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   407
  > EOF
23093
a3fee83dba59 tests: use "%HG_ARGS%" in shell alias on Windows instead of "$HG_ARGS"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 22765
diff changeset
   408
#endif
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   409
  $ hg reba
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   410
  hg: command 'reba' is ambiguous:
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   411
      rebase rebate
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   412
  [255]
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   413
  $ hg rebat
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   414
  this is rebate
22377
f98abe3146b2 dispatch: check shell alias again after loading extensions (issue4355)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21572
diff changeset
   415
  $ hg rebat --foo-bar
f98abe3146b2 dispatch: check shell alias again after loading extensions (issue4355)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21572
diff changeset
   416
  this is rebate --foo-bar
13434
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   417
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   418
invalid arguments
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   419
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   420
  $ hg rt foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   421
  hg rt: invalid arguments
15203
c7ce651a6bc9 help: generate command help into a single RST string for formatting
Matt Mackall <mpm@selenic.com>
parents: 14890
diff changeset
   422
  hg rt
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   423
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   424
  alias for: hg root
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   425
  
22111
aa5e256839d5 help: improve command summary hint
Matt Mackall <mpm@selenic.com>
parents: 21572
diff changeset
   426
  (use "hg rt -h" to show more help)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 11989
diff changeset
   427
  [255]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   428
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   429
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
   430
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   431
  $ hg --invalid root
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   432
  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
   433
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   434
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   435
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   436
  
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   437
   add           add the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   438
   annotate      show changeset information by line for each file
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   439
   clone         make a copy of an existing repository
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   440
   commit        commit the specified files or all outstanding changes
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   441
   diff          diff repository (or selected files)
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   442
   export        dump the header and diffs for one or more changesets
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   443
   forget        forget the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   444
   init          create a new repository in the given directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   445
   log           show revision history of entire repository or files
23400
3bd577a3283e merge: be precise about what merged into what in short desc
anatoly techtonik <techtonik@gmail.com>
parents: 23093
diff changeset
   446
   merge         merge another revision into working directory
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   447
   pull          pull changes from the specified source
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   448
   push          push changes to the specified destination
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   449
   remove        remove the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   450
   serve         start stand-alone webserver
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   451
   status        show changed files in the working directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   452
   summary       summarize working directory state
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   453
   update        update working directory (or switch revisions)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   454
  
22118
9a299c39de01 help: normalize helplist hints
Matt Mackall <mpm@selenic.com>
parents: 22111
diff changeset
   455
  (use "hg help" for the full list of commands or "hg -v" for details)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   456
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   457
  $ hg --invalid mylog
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   458
  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
   459
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   460
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   461
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   462
  
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   463
   add           add the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   464
   annotate      show changeset information by line for each file
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   465
   clone         make a copy of an existing repository
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   466
   commit        commit the specified files or all outstanding changes
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   467
   diff          diff repository (or selected files)
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   468
   export        dump the header and diffs for one or more changesets
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   469
   forget        forget the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   470
   init          create a new repository in the given directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   471
   log           show revision history of entire repository or files
23400
3bd577a3283e merge: be precise about what merged into what in short desc
anatoly techtonik <techtonik@gmail.com>
parents: 23093
diff changeset
   472
   merge         merge another revision into working directory
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   473
   pull          pull changes from the specified source
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   474
   push          push changes to the specified destination
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   475
   remove        remove the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   476
   serve         start stand-alone webserver
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   477
   status        show changed files in the working directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   478
   summary       summarize working directory state
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   479
   update        update working directory (or switch revisions)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   480
  
22118
9a299c39de01 help: normalize helplist hints
Matt Mackall <mpm@selenic.com>
parents: 22111
diff changeset
   481
  (use "hg help" for the full list of commands or "hg -v" for details)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   482
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   483
  $ hg --invalid blank
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   484
  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
   485
  Mercurial Distributed SCM
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   486
  
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   487
  basic commands:
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   488
  
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   489
   add           add the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   490
   annotate      show changeset information by line for each file
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   491
   clone         make a copy of an existing repository
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   492
   commit        commit the specified files or all outstanding changes
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   493
   diff          diff repository (or selected files)
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   494
   export        dump the header and diffs for one or more changesets
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   495
   forget        forget the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   496
   init          create a new repository in the given directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   497
   log           show revision history of entire repository or files
23400
3bd577a3283e merge: be precise about what merged into what in short desc
anatoly techtonik <techtonik@gmail.com>
parents: 23093
diff changeset
   498
   merge         merge another revision into working directory
16853
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   499
   pull          pull changes from the specified source
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   500
   push          push changes to the specified destination
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   501
   remove        remove the specified files on the next commit
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   502
   serve         start stand-alone webserver
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   503
   status        show changed files in the working directory
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   504
   summary       summarize working directory state
7863ff383894 help: format command and option list help using RST
Olav Reinert <seroton10@gmail.com>
parents: 16609
diff changeset
   505
   update        update working directory (or switch revisions)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   506
  
22118
9a299c39de01 help: normalize helplist hints
Matt Mackall <mpm@selenic.com>
parents: 22111
diff changeset
   507
  (use "hg help" for the full list of commands or "hg -v" for details)
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   508
  [255]
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   509
15600
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   510
This should show id:
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   511
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   512
  $ hg --config alias.log='id' log
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   513
  000000000000 tip
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   514
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   515
This shouldn't:
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   516
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   517
  $ hg --config alias.log='id' history
16912
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16853
diff changeset
   518
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16853
diff changeset
   519
  $ cd ../..
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   520
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   521
return code of command and shell aliases:
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   522
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   523
  $ hg mycommit -R alias
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   524
  nothing changed
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   525
  [1]
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   526
  $ hg exit1
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   527
  [1]