tests/test-alias.t
author Matt Harbison <matt_harbison@yahoo.com>
Mon, 21 Aug 2023 16:53:16 -0400
changeset 50946 4135e7271b9e
parent 49771 f0e9dda408b3
child 50987 727428c7e1fc
permissions -rw-r--r--
debugdata: migrate `opts` to native kwargs
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
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
     7
  > myinit:doc = This is my documented alias for init.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
     8
  > myinit:help = [OPTIONS] [BLA] [BLE]
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
     9
  > mycommit = commit
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    10
  > mycommit:doc = This is my alias with only doc.
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
    11
  > optionalrepo = showconfig alias.myinit
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    12
  > cleanstatus = status -c
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    13
  > cleanstatus:help = [ONLYHELPHERE]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    14
  > unknown = bargle
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    15
  > ambiguous = s
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    16
  > recursive = recursive
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
    17
  > disabled = email
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    18
  > nodefinition =
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
    19
  > noclosingquotation = '
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    20
  > no--cwd = status --cwd elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    21
  > no-R = status -R elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    22
  > no--repo = status --repo elsewhere
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    23
  > 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
    24
  > no--config = status --config a.config=1
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    25
  > mylog = log
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    26
  > lognull = log -r null
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    27
  > lognull:doc = Logs the null rev
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    28
  > lognull:help = foo bar baz
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    29
  > 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
    30
  > positional = log --template '{\$2} {\$1} | {date|isodate}\n'
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    31
  > dln = lognull --debug
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    32
  > recursivedoc = dln
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    33
  > recursivedoc:doc = Logs the null rev in debug mode
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    34
  > nousage = rollback
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    35
  > put = export -r 0 -o "\$FOO/%R.diff"
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    36
  > blank = !printf '\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    37
  > self = !printf '\$0\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    38
  > echoall = !printf '\$@\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    39
  > echo1 = !printf '\$1\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    40
  > echo2 = !printf '\$2\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    41
  > 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
    42
  > echotokens = !printf "%s\n" "\$@"
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    43
  > 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
    44
  > 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
    45
  > rt = root
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 18991
diff changeset
    46
  > 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
    47
  > idalias = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    48
  > idaliaslong = id
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
    49
  > 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
    50
  > 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
    51
  > parentsshell2 = !echo two
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    52
  > escaped1 = !printf 'test\$\$test\n'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    53
  > escaped2 = !sh -c 'echo "HGFOO is \$\$HGFOO"'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    54
  > escaped3 = !sh -c 'echo "\$1 is \$\$\$1"'
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
    55
  > 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
    56
  > exit1 = !sh -c 'exit 1'
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    57
  > 
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    58
  > [defaults]
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    59
  > mylog = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    60
  > lognull = -q
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    61
  > log = -v
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    62
  > EOF
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
basic
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
  $ hg myinit alias
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
    67
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    68
help
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    69
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    70
  $ hg help -c | grep myinit
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    71
   myinit       This is my documented alias for init.
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    72
  $ hg help -c | grep mycommit
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    73
   mycommit     This is my alias with only doc.
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    74
  $ hg help -c | grep cleanstatus
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    75
  [1]
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    76
  $ hg help -c | grep lognull
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    77
   lognull      Logs the null rev
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    78
  $ hg help -c | grep dln
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    79
  [1]
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    80
  $ hg help -c | grep recursivedoc
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
    81
   recursivedoc Logs the null rev in debug mode
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    82
  $ hg help myinit
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    83
  hg myinit [OPTIONS] [BLA] [BLE]
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    84
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    85
  alias for: hg init
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    86
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    87
  This is my documented alias for init.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    88
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    89
  defined by: * (glob)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    90
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    91
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    92
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    93
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    94
  options:
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    95
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    96
   -e --ssh CMD       specify ssh command to use
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    97
      --remotecmd CMD specify hg command to run on the remote side
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    98
      --insecure      do not verify server certificate (ignoring web.cacerts
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
    99
                      config)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   100
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   101
  (some details hidden, use --verbose to show complete help)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   102
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   103
  $ hg help mycommit
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   104
  hg mycommit [OPTION]... [FILE]...
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   105
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   106
  alias for: hg commit
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   107
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   108
  This is my alias with only doc.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   109
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   110
  defined by: * (glob)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   111
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   112
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   113
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   114
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   115
  options ([+] can be repeated):
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   116
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   117
   -A --addremove           mark new/missing files as added/removed before
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   118
                            committing
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   119
      --close-branch        mark a branch head as closed
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   120
      --amend               amend the parent of the working directory
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   121
   -s --secret              use the secret phase for committing
49771
f0e9dda408b3 commit: add --draft option to use draft phase
Martin von Zweigbergk <martinvonz@google.com>
parents: 46262
diff changeset
   122
      --draft               use the draft phase for committing
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   123
   -e --edit                invoke editor on commit messages
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   124
   -i --interactive         use interactive mode
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   125
   -I --include PATTERN [+] include names matching the given patterns
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   126
   -X --exclude PATTERN [+] exclude names matching the given patterns
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   127
   -m --message TEXT        use text as commit message
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   128
   -l --logfile FILE        read commit message from file
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   129
   -d --date DATE           record the specified date as commit date
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   130
   -u --user USER           record the specified user as committer
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   131
   -S --subrepos            recurse into subrepositories
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   132
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   133
  (some details hidden, use --verbose to show complete help)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   135
  $ hg help cleanstatus
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   136
  hg cleanstatus [ONLYHELPHERE]
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   137
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   138
  alias for: hg status -c
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   139
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   140
  show changed files in the working directory
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   141
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   142
      Show status of files in the repository. If names are given, only files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   143
      that match are shown. Files that are clean or ignored or the source of a
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   144
      copy/move operation, are not listed unless -c/--clean, -i/--ignored,
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   145
      -C/--copies or -A/--all are given. Unless options described with "show
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   146
      only ..." are given, the options -mardu are used.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   147
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   148
      Option -q/--quiet hides untracked (unknown and ignored) files unless
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   149
      explicitly requested with -u/--unknown or -i/--ignored.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   150
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   151
      Note:
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   152
         'hg status' may appear to disagree with diff if permissions have
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   153
         changed or a merge has occurred. The standard diff format does not
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   154
         report permission changes and diff only reports changes relative to one
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   155
         merge parent.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   156
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   157
      If one revision is given, it is used as the base revision. If two
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   158
      revisions are given, the differences between them are shown. The --change
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   159
      option can also be used as a shortcut to list the changed files of a
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   160
      revision from its first parent.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   161
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   162
      The codes used to show the status of files are:
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   163
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   164
        M = modified
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   165
        A = added
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   166
        R = removed
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   167
        C = clean
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   168
        ! = missing (deleted by non-hg command, but still tracked)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   169
        ? = not tracked
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   170
        I = ignored
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   171
          = origin of the previous file (with --copies)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   172
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   173
      Returns 0 on success.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   174
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   175
  defined by: * (glob)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   176
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   177
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   178
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   179
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   180
  options ([+] can be repeated):
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   181
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   182
   -A --all                 show status of all files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   183
   -m --modified            show only modified files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   184
   -a --added               show only added files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   185
   -r --removed             show only removed files
45134
487df3676d2c status: match category text in the option description
Joerg Sonnenberger <joerg@bec.de>
parents: 42418
diff changeset
   186
   -d --deleted             show only missing files
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   187
   -c --clean               show only files without changes
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   188
   -u --unknown             show only unknown (not tracked) files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   189
   -i --ignored             show only ignored files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   190
   -n --no-status           hide status prefix
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   191
   -C --copies              show source of copied files
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   192
   -0 --print0              end filenames with NUL, for use with xargs
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   193
      --rev REV [+]         show difference from revision
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   194
      --change REV          list the changed files of a revision
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   195
   -I --include PATTERN [+] include names matching the given patterns
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   196
   -X --exclude PATTERN [+] exclude names matching the given patterns
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   197
   -S --subrepos            recurse into subrepositories
39931
0d703063d0c8 formatter: remove experimental marker from -T option
Yuya Nishihara <yuya@tcha.org>
parents: 38788
diff changeset
   198
   -T --template TEMPLATE   display with template
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   199
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   200
  (some details hidden, use --verbose to show complete help)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   201
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   202
  $ hg help recursivedoc | head -n 5
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   203
  hg recursivedoc foo bar baz
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   204
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   205
  alias for: hg dln
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   206
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   207
  Logs the null rev in debug mode
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   208
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   209
unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   210
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   211
  $ hg unknown
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   212
  config error: alias 'unknown' resolves to unknown command 'bargle'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   213
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   214
  $ hg help unknown
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   215
  alias 'unknown' resolves to unknown command 'bargle'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   216
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   217
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   218
ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   219
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   220
  $ hg ambiguous
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   221
  config error: alias 'ambiguous' resolves to ambiguous command 's'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   222
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   223
  $ hg help ambiguous
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   224
  alias 'ambiguous' resolves to ambiguous command 's'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   225
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   226
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   227
recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   228
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   229
  $ hg recursive
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   230
  config error: alias 'recursive' resolves to unknown command 'recursive'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   231
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   232
  $ hg help recursive
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   233
  alias 'recursive' resolves to unknown command 'recursive'
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   234
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   235
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   236
disabled
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   237
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   238
  $ hg disabled
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   239
  config error: alias 'disabled' resolves to unknown command 'email'
22164
efd65e51bc0b alias: exit from bad definition by Abort
Yuya Nishihara <yuya@tcha.org>
parents: 22163
diff changeset
   240
  ('email' is provided by 'patchbomb' extension)
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   241
  [30]
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   242
  $ hg help disabled
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   243
  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
   244
  
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   245
  '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
   246
  
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   247
      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
   248
  
29974
7109d5ddeb0c help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents: 29087
diff changeset
   249
  (use 'hg help extensions' for information on enabling extensions)
22159
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   250
db7921812f56 alias: add test for alias command provided by disabled extension
Yuya Nishihara <yuya@tcha.org>
parents: 22158
diff changeset
   251
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   252
no definition
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
   253
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   254
  $ hg nodef
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   255
  config error: no definition for alias 'nodefinition'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   256
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   257
  $ hg help nodef
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   258
  no definition for alias 'nodefinition'
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   259
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   260
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   261
no closing quotation
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   262
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   263
  $ hg noclosing
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   264
  config error: error in definition for alias 'noclosingquotation': No closing quotation
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   265
  [30]
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   266
  $ hg help noclosing
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   267
  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
   268
35225
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   269
"--" in alias definition should be preserved
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   270
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   271
  $ hg --config alias.dash='cat --' -R alias dash -r0
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   272
  abort: -r0 not under root '$TESTTMP/alias'
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   273
  (consider using '--cwd alias')
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   274
  [255]
21569
c5afb07c33d3 alias: handle shlex error in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 21556
diff changeset
   275
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   276
invalid options
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   277
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   278
  $ hg no--cwd
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   279
  config error: error in definition for alias 'no--cwd': --cwd may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   280
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   281
  $ hg help no--cwd
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   282
  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
   283
  command line
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   284
  $ hg no-R
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   285
  config error: error in definition for alias 'no-R': -R may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   286
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   287
  $ hg help no-R
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   288
  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
   289
  $ hg no--repo
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   290
  config error: error in definition for alias 'no--repo': --repo may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   291
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   292
  $ hg help no--repo
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   293
  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
   294
  command line
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   295
  $ hg no--repository
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   296
  config error: error in definition for alias 'no--repository': --repository may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   297
  [30]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   298
  $ hg help no--repository
22162
7ada34676db8 help: provide help of bad alias without executing aliascmd()
Yuya Nishihara <yuya@tcha.org>
parents: 22159
diff changeset
   299
  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
   300
  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
   301
  $ hg no--config
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   302
  config error: error in definition for alias 'no--config': --config may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   303
  [30]
35225
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   304
  $ hg no --config alias.no='--repo elsewhere --cwd elsewhere status'
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   305
  config error: error in definition for alias 'no': --repo/--cwd may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   306
  [30]
35225
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   307
  $ hg no --config alias.no='--repo elsewhere'
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   308
  config error: error in definition for alias 'no': --repo may only be given on the command line
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   309
  [30]
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   310
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   311
optional repository
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   312
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16965
diff changeset
   313
#if no-outer-repo
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   314
  $ hg optionalrepo
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   315
  init
17015
73d20de5f30b tests: add missing no-outer-repo requirements
Mads Kiilerich <mads@kiilerich.com>
parents: 16965
diff changeset
   316
#endif
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   317
  $ cd alias
16609
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   318
  $ cat > .hg/hgrc <<EOF
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   319
  > [alias]
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   320
  > myinit = init -q
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   321
  > EOF
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   322
  $ hg optionalrepo
d36a384bec87 alias: inherit command optionalrepo flag (issue3298)
Patrick Mezard <patrick@mezard.eu>
parents: 16294
diff changeset
   323
  init -q
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   324
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   325
no usage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   326
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   327
  $ hg nousage
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   328
  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
   329
  [1]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   330
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   331
  $ 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
   332
  $ hg commit -Amfoo
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   333
  adding foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   334
27679
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   335
infer repository
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   336
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   337
  $ cd ..
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   338
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   339
#if no-outer-repo
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   340
  $ hg shortlog alias/foo
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   341
  0 e63c23eaa88a | 1970-01-01 00:00 +0000
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   342
#endif
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   343
6822f9382b4c dispatch: copy inferrepo attribute to alias commands
Yuya Nishihara <yuya@tcha.org>
parents: 27623
diff changeset
   344
  $ cd alias
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   345
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   346
with opts
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   347
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   348
  $ hg cleanst
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   349
  C foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   350
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   351
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   352
with opts and whitespace
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   353
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   354
  $ hg shortlog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   355
  0 e63c23eaa88a | 1970-01-01 00:00 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   356
14265
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   357
positional arguments
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   358
16294
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   359
  $ hg positional
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   360
  abort: too few arguments for command alias
45914
be25b66f86ab errors: raise InputError when too few arguments given to alias
Martin von Zweigbergk <martinvonz@google.com>
parents: 45912
diff changeset
   361
  [10]
16294
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   362
  $ hg positional a
795d591b6ef5 alias: abort on missing positional args (issue3331)
Matt Mackall <mpm@selenic.com>
parents: 15862
diff changeset
   363
  abort: too few arguments for command alias
45914
be25b66f86ab errors: raise InputError when too few arguments given to alias
Martin von Zweigbergk <martinvonz@google.com>
parents: 45912
diff changeset
   364
  [10]
14265
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   365
  $ hg positional 'node|short' rev
e4ab5ae193f2 add positional arguments to non-shell aliases
Alexander Solovyov <alexander@solovyov.net>
parents: 13950
diff changeset
   366
  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
   367
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   368
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
   369
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   370
  $ hg mylog
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   371
  0:e63c23eaa88a
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   372
  $ hg lognull
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   373
  -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
   374
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   375
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   376
properly recursive
4801
6aa1fae4c28a Add alias extension
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
   377
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   378
  $ hg dln
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   379
  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
   380
  phase:       public
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   381
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   382
  parent:      -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   383
  manifest:    -1:0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   384
  user:        
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   385
  date:        Thu Jan 01 00:00:00 1970 +0000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   386
  extra:       branch=default
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   387
  
8477
a0104303f400 alias: honor the [defaults] section, fix issue1642
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 5523
diff changeset
   388
8519
5fbee915ea5d alias: a0104303f400 did not correctly handle whitespace in the args
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 8477
diff changeset
   389
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   390
path expanding
8655
21688b8a594b Move alias into core
Brendan Cully <brendan@kublai.com>
parents: 8519
diff changeset
   391
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   392
  $ FOO=`pwd` hg put
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   393
  $ cat 0.diff
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   394
  # HG changeset patch
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   395
  # User test
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   396
  # 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
   397
  #      Thu Jan 01 00:00:00 1970 +0000
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   398
  # Node ID e63c23eaa88ae77967edcf4ea194d31167c478b0
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   399
  # Parent  0000000000000000000000000000000000000000
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   400
  foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   401
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   402
  diff -r 000000000000 -r e63c23eaa88a foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   403
  --- /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
   404
  +++ 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
   405
  @@ -0,0 +1,1 @@
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   406
  +foo
10793
16df09a54113 expand paths in aliases
Alexander Solovyov <piranha@piranha.org.ua>
parents: 10021
diff changeset
   407
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   408
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   409
simple shell aliases
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   410
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   411
  $ hg blank
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   412
  
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   413
  $ hg blank foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   414
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   415
  $ 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
   416
  self
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   417
  $ hg echoall
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   418
  
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   419
  $ hg echoall foo
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   420
  foo
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   421
  $ 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
   422
  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
   423
  $ 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
   424
  test $@ foo $@
bd45d92883f9 test-alias: add some tests to ensure we aren't double-substituting
Siddharth Agarwal <sid0@fb.com>
parents: 22118
diff changeset
   425
  $ 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
   426
  test "$@" foo "$@"
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   427
  $ 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
   428
  foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   429
  $ 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
   430
  bar
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   431
  $ 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
   432
  foo baz
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   433
  $ hg echo2 foo
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   434
  
22158
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   435
  $ hg echotokens
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   436
  
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   437
  $ 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
   438
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   439
  bar $1 baz
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   440
  $ 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
   441
  test $2
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   442
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   443
  $ hg echotokens 'test $@' foo '$@'
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   444
  test $@
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   445
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   446
  $@
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   447
  $ hg echotokens 'test "$@"' foo '"$@"'
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   448
  test "$@"
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   449
  foo
bc2132dfc0a4 alias: expand "$@" as list of parameters quoted individually (BC) (issue4200)
Siddharth Agarwal <sid0@fb.com>
parents: 22157
diff changeset
   450
  "$@"
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   451
  $ 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
   452
  $ 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
   453
  $ hg count .
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   454
  1
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   455
  $ 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
   456
  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
   457
  $ 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
   458
  2
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   459
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   460
  $ 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
   461
  @  1:042423737847: 'bar'
12656
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   462
  |
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   463
  o  0:e63c23eaa88a: 'foo'
929b424e1146 tests: add testcase for 208fc9ad6a48 to test-alias.t
Adrian Buehlmann <adrian@cadifra.com>
parents: 12536
diff changeset
   464
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   465
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   466
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   467
shadowing
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   468
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   469
  $ hg i
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   470
  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
   471
      idalias idaliaslong idaliasshell identify import incoming init
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   472
  [10]
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   473
  $ 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
   474
  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
   475
  $ hg ida
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   476
  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
   477
      idalias idaliaslong idaliasshell
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   478
  [10]
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   479
  $ 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
   480
  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
   481
  $ 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
   482
  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
   483
  $ hg idaliass
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   484
  test
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   485
  $ hg parentsshell
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   486
  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
   487
      parentsshell1 parentsshell2
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   488
  [10]
12932
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   489
  $ hg parentsshell1
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   490
  one
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   491
  $ hg parentsshell2
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   492
  two
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   493
ab93029ab622 alias: fall back to normal error handling for ambigious commands (fixes issue2475)
Steve Losh <steve@stevelosh.com>
parents: 12748
diff changeset
   494
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   495
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
   496
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   497
  $ 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
   498
  $ 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
   499
  $ hg count 'branch(default)'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45134
diff changeset
   500
  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
   501
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   502
  $ hg -v count 'branch(default)'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45134
diff changeset
   503
  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
   504
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   505
  $ hg -R .. count 'branch(default)'
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45134
diff changeset
   506
  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
   507
  0
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   508
  $ 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
   509
  2
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   510
  $ hg echoall --cwd ..
14886
9a3831d64ae2 dispatch: move shell alias handling after early arg handling
Matt Mackall <mpm@selenic.com>
parents: 14265
diff changeset
   511
  
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   512
35225
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   513
"--" passed to shell alias should be preserved
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   514
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   515
  $ hg --config alias.printf='!printf "$@"' printf '%s %s %s\n' -- --cwd ..
7ce0ba3a1c32 dispatch: replace _earlygetopt(strip=True) with new parser
Yuya Nishihara <yuya@tcha.org>
parents: 34484
diff changeset
   516
  -- --cwd ..
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   517
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   518
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
   519
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   520
  $ 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
   521
  > [alias]
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   522
  > 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
   523
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   524
  $ 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
   525
  > [alias]
16965
91284af53508 test-alias: adapt for Windows
Mads Kiilerich <mads@kiilerich.com>
parents: 16912
diff changeset
   526
  > 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
   527
  > EOF
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   528
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   529
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   530
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
   531
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   532
  $ 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
   533
  sub
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   534
  $ 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
   535
  hg: unknown command 'subalias'
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 24222
diff changeset
   536
  (did you mean idalias?)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   537
  [10]
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   538
  $ hg -R .. subalias > /dev/null
14890
28abca72c46c alias: fix up test results
Matt Mackall <mpm@selenic.com>
parents: 14886
diff changeset
   539
  hg: unknown command 'subalias'
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 24222
diff changeset
   540
  (did you mean idalias?)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   541
  [10]
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   542
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   543
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   544
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
   545
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   546
  $ 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
   547
  hg: unknown command 'mainalias'
27623
b3376fba4ab9 dispatch: report similar names consistently
Bryan O'Sullivan <bos@serpentine.com>
parents: 24222
diff changeset
   548
  (did you mean idalias?)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   549
  [10]
12536
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   550
  $ 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
   551
  main
208fc9ad6a48 alias: only allow global options before a shell alias, pass later ones through
Steve Losh <steve@stevelosh.com>
parents: 12327
diff changeset
   552
  $ 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
   553
  main
11989
f853873fc66d aliases: provide more flexible ways to work with shell alias arguments
Steve Losh <steve@stevelosh.com>
parents: 11814
diff changeset
   554
24222
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 23934
diff changeset
   555
typos get useful suggestions
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 23934
diff changeset
   556
  $ hg --cwd .. manalias
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 23934
diff changeset
   557
  hg: unknown command 'manalias'
02d7b5cd373b dispatch: offer suggestions of similar-named commands
Augie Fackler <augie@google.com>
parents: 23934
diff changeset
   558
  (did you mean one of idalias, mainalias, manifest?)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   559
  [10]
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   560
13434
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   561
shell aliases with escaped $ chars
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   562
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   563
  $ hg escaped1
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   564
  test$test
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   565
  $ hg escaped2
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   566
  HGFOO is BAR
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   567
  $ hg escaped3 HGFOO
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   568
  HGFOO is BAR
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   569
  $ hg escaped4 test
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   570
  $0 $@
b5cc838dd999 alias: add test cases for $ escaping in shell aliases
Steve Losh <steve@stevelosh.com>
parents: 12932
diff changeset
   571
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   572
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
   573
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
   574
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   575
  $ cat >> .hg/hgrc <<EOF
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   576
  > [extensions]
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   577
  > 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
   578
  > 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
   579
#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
   580
  $ 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
   581
  > [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
   582
  > 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
   583
  > 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
   584
#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
   585
  $ 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
   586
  > [alias]
22377
f98abe3146b2 dispatch: check shell alias again after loading extensions (issue4355)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 21572
diff changeset
   587
  > 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
   588
  > 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
   589
#endif
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   590
  $ cat >> .hg/hgrc <<EOF
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   591
  > rebate:doc = This is my alias which just prints something.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   592
  > rebate:help = [MYARGS]
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   593
  > EOF
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   594
  $ hg reba
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   595
  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
   596
      rebase rebate
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   597
  [10]
20328
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   598
  $ hg rebat
03d345da0579 dispatch: make "_checkshellalias()" invoke "findcmd()" with "strict=True"
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20117
diff changeset
   599
  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
   600
  $ 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
   601
  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
   602
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   603
help for a shell alias
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   604
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   605
  $ hg help -c | grep rebate
40414
444861dc1e55 help: displaying documented aliases by default
rdamazio@google.com
parents: 39931
diff changeset
   606
   rebate       This is my alias which just prints something.
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   607
  $ hg help rebate
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   608
  hg rebate [MYARGS]
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   609
  
37144
004ecdbe96ec tests: conditionalize printed environment variable output in test-alias
Matt Harbison <matt_harbison@yahoo.com>
parents: 37139
diff changeset
   610
  shell alias for: echo this is %HG_ARGS% (windows !)
004ecdbe96ec tests: conditionalize printed environment variable output in test-alias
Matt Harbison <matt_harbison@yahoo.com>
parents: 37139
diff changeset
   611
  shell alias for: echo this is $HG_ARGS (no-windows !)
37134
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   612
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   613
  This is my alias which just prints something.
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   614
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   615
  defined by:* (glob)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   616
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   617
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   618
  */* (glob) (?)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   619
  
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   620
  (some details hidden, use --verbose to show complete help)
6890b7e991a4 help: supporting both help and doc for aliases
Rodrigo Damazio <rdamazio@google.com>
parents: 36380
diff changeset
   621
37139
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   622
invalid character in user-specified help
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   623
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   624
  >>> with open('.hg/hgrc', 'ab') as f:
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   625
  ...     f.write(b'[alias]\n'
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   626
  ...             b'invaliddoc = log\n'
40672
557d3509da55 tests: make test-alias.t pass with re2
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40414
diff changeset
   627
  ...             b'invaliddoc:doc = \xc3\xa9\n'
37139
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   628
  ...             b'invalidhelp = log\n'
40672
557d3509da55 tests: make test-alias.t pass with re2
Valentin Gatien-Baron <vgatien-baron@janestreet.com>
parents: 40414
diff changeset
   629
  ...             b'invalidhelp:help = \xc3\xa9\n') and None
37139
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   630
  $ hg help invaliddoc
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   631
  non-ASCII character in alias definition 'invaliddoc:doc'
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   632
  $ hg help invalidhelp
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   633
  non-ASCII character in alias definition 'invalidhelp:help'
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   634
  $ hg invaliddoc
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   635
  config error: non-ASCII character in alias definition 'invaliddoc:doc'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   636
  [30]
37139
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   637
  $ hg invalidhelp
45912
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   638
  config error: non-ASCII character in alias definition 'invalidhelp:help'
35ab6e39f482 errors: raise ConfigError on bad alias definition
Martin von Zweigbergk <martinvonz@google.com>
parents: 45911
diff changeset
   639
  [30]
37139
aa55c5354b8f alias: reject non-ascii characters in user help/doc strings
Yuya Nishihara <yuya@tcha.org>
parents: 37134
diff changeset
   640
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   641
invalid arguments
11676
e4357c214bf1 alias: ensure checksignature() is applied directly to the command (issue2286)
Brodie Rao <brodie@bitheap.org>
parents: 11460
diff changeset
   642
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   643
  $ hg rt foo
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   644
  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
   645
  hg rt
11814
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   646
  
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   647
  alias for: hg root
61b0a01182d5 tests: unify test-alias
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 11695
diff changeset
   648
  
42418
9803323048b6 root: add support for -Tformatter option
Yuya Nishihara <yuya@tcha.org>
parents: 40672
diff changeset
   649
  options:
9803323048b6 root: add support for -Tformatter option
Yuya Nishihara <yuya@tcha.org>
parents: 40672
diff changeset
   650
  
9803323048b6 root: add support for -Tformatter option
Yuya Nishihara <yuya@tcha.org>
parents: 40672
diff changeset
   651
   -T --template TEMPLATE display with template
9803323048b6 root: add support for -Tformatter option
Yuya Nishihara <yuya@tcha.org>
parents: 40672
diff changeset
   652
  
29974
7109d5ddeb0c help: use single quotes in use warning
timeless <timeless@mozdev.org>
parents: 29087
diff changeset
   653
  (use 'hg rt -h' to show more help)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   654
  [10]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   655
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   656
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
   657
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   658
  $ hg --invalid root
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   659
  hg: option --invalid not recognized
38788
a9ff2b0c11dd dispatch: show a short error message when invalid global option given
Martin von Zweigbergk <martinvonz@google.com>
parents: 37144
diff changeset
   660
  (use 'hg help -v' for a list of global options)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   661
  [10]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   662
  $ hg --invalid mylog
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   663
  hg: option --invalid not recognized
38788
a9ff2b0c11dd dispatch: show a short error message when invalid global option given
Martin von Zweigbergk <martinvonz@google.com>
parents: 37144
diff changeset
   664
  (use 'hg help -v' for a list of global options)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   665
  [10]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   666
  $ hg --invalid blank
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   667
  hg: option --invalid not recognized
38788
a9ff2b0c11dd dispatch: show a short error message when invalid global option given
Martin von Zweigbergk <martinvonz@google.com>
parents: 37144
diff changeset
   668
  (use 'hg help -v' for a list of global options)
46262
9c9e0b4b2ca7 error: use detailed exit code 10 for command errors
Martin von Zweigbergk <martinvonz@google.com>
parents: 45914
diff changeset
   669
  [10]
12748
d10369fefd01 alias: fail gracefully when invalid global options are given (issue2442)
Steve Losh <steve@stevelosh.com>
parents: 12656
diff changeset
   670
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   671
environment variable changes in alias commands
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   672
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   673
  $ cat > $TESTTMP/expandalias.py <<EOF
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   674
  > import os
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   675
  > from mercurial import cmdutil, commands, registrar
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   676
  > cmdtable = {}
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   677
  > command = registrar.command(cmdtable)
36380
2bff5f05b01b py3: add b'' prefixes in test-alias.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35225
diff changeset
   678
  > @command(b'expandalias')
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   679
  > def expandalias(ui, repo, name):
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   680
  >     alias = cmdutil.findcmd(name, commands.table)[1][0]
36380
2bff5f05b01b py3: add b'' prefixes in test-alias.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35225
diff changeset
   681
  >     ui.write(b'%s args: %s\n' % (name, b' '.join(alias.args)))
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   682
  >     os.environ['COUNT'] = '2'
36380
2bff5f05b01b py3: add b'' prefixes in test-alias.t
Pulkit Goyal <7895pulkit@gmail.com>
parents: 35225
diff changeset
   683
  >     ui.write(b'%s args: %s (with COUNT=2)\n' % (name, b' '.join(alias.args)))
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   684
  > EOF
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   685
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   686
  $ cat >> $HGRCPATH <<'EOF'
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   687
  > [extensions]
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   688
  > expandalias = $TESTTMP/expandalias.py
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   689
  > [alias]
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   690
  > showcount = log -T "$COUNT" -r .
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   691
  > EOF
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   692
34484
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   693
  $ COUNT=1 hg expandalias showcount
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   694
  showcount args: -T 1 -r .
a8a9c0d3232b test-alias: make it compatible with chg
Jun Wu <quark@fb.com>
parents: 29974
diff changeset
   695
  showcount args: -T 2 -r . (with COUNT=2)
29087
ad1bdea43965 dispatch: defer environment variable resolution in alias commands (BC)
Jun Wu <quark@fb.com>
parents: 27679
diff changeset
   696
15600
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   697
This should show id:
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   698
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   699
  $ 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
   700
  000000000000 tip
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   701
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   702
This shouldn't:
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   703
195dbd1cef0c alias: shortcut command matching show shadowing works properly (issue3104)
Matt Mackall <mpm@selenic.com>
parents: 15233
diff changeset
   704
  $ 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
   705
6ef3107c661e tests: cleanup of tests that got lost in their own nested directories
Mads Kiilerich <mads@kiilerich.com>
parents: 16853
diff changeset
   706
  $ cd ../..
21556
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   707
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   708
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
   709
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   710
  $ 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
   711
  nothing changed
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   712
  [1]
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   713
  $ hg exit1
5e13507a3b4e alias: fix loss of non-zero return code in command aliases
Yuya Nishihara <yuya@tcha.org>
parents: 20328
diff changeset
   714
  [1]
23934
975c4fc4a512 hg.bat: return exit code explicitly for indirect invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23400
diff changeset
   715
975c4fc4a512 hg.bat: return exit code explicitly for indirect invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23400
diff changeset
   716
#if no-outer-repo
975c4fc4a512 hg.bat: return exit code explicitly for indirect invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23400
diff changeset
   717
  $ hg root
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45134
diff changeset
   718
  abort: no repository found in '$TESTTMP' (.hg not found)
45911
8939062597f0 errors: raise InputError on bad repo arguments
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   719
  [10]
23934
975c4fc4a512 hg.bat: return exit code explicitly for indirect invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23400
diff changeset
   720
  $ hg --config alias.hgroot='!hg root' hgroot
45906
95c4cca641f6 errors: remove trailing "!" from some error messages for consistency
Martin von Zweigbergk <martinvonz@google.com>
parents: 45134
diff changeset
   721
  abort: no repository found in '$TESTTMP' (.hg not found)
45911
8939062597f0 errors: raise InputError on bad repo arguments
Martin von Zweigbergk <martinvonz@google.com>
parents: 45906
diff changeset
   722
  [10]
23934
975c4fc4a512 hg.bat: return exit code explicitly for indirect invocation
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 23400
diff changeset
   723
#endif