annotate contrib/zsh_completion @ 3497:459e7cd943d4

zsh: complete according to the -R option if specified
author Brendan Cully <brendan@kublai.com>
date Tue, 24 Oct 2006 13:09:09 -0700
parents 72b9a3b8bb1d
children 776c317566b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
1 #compdef hg
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
2
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
3 # Zsh completion script for mercurial. Rename this file to _hg and copy
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
4 # it into your zsh function path (/usr/share/zsh/site-functions for
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
5 # instance)
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
6 #
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
7 # Copyright (C) 2005 Steve Borho
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
8 #
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
9 # This is free software; you can redistribute it and/or modify it under
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
10 # the terms of the GNU General Public License as published by the Free
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
11 # Software Foundation; either version 2 of the License, or (at your
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
12 # option) any later version.
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
13 #
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
14
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
15 local curcontext="$curcontext" state line
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
16 typeset -A opt_args
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
17 local subcmds repos newFiles addedFiles includeExclude commitMessage
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
18 local ridx _hgroot
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
19
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
20 # FIXME: why isn't opt_args available?
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
21 [[ -d .hg ]] && _hgroot="$PWD"
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
22 ridx=$words[(i)-R]
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
23 (( $ridx < $#words )) && _hgroot="${words[$ridx+1]}"
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
24
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
25 # hg dispatch (borrowed from _cvs)
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
26 (( $+functions[_hg_cmd] )) ||
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
27 _hg_cmd () {
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
28 _call_program hg hg -R "$_hgroot" "$@"
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
29 }
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
30
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
31 (( $+functions[_hg_state] )) ||
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
32 _hg_state () {
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
33 case "$state" in
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
34 (tags)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
35 compadd $(_hg_cmd tags 2> /dev/null |
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
36 sed -e 's/[0-9]*:[a-f0-9]*$//; s/ *$//')
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
37 ;;
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
38 (qapplied)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
39 compadd $(_hg_cmd qapplied)
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
40 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
41 (qunapplied)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
42 compadd $(_hg_cmd qunapplied)
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
43 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
44 esac
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
45 }
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
46
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
47 subcmds=($(hg -v help | sed -e '1,/^list of commands:/d' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
48 -e '/^global options:/,$d' -e '/^ [^ ]/!d; s/[,:].*//g;'))
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
49
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
50 # A lot of commands have these arguments
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
51 includeExclude=(
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
52 '*-I-[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
53 '*--include-[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
54 '*-X-[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
55 '*--exclude-[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
56
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
57 styleOpts=(
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
58 '--style[display using template map file]:'
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
59 '--template[display with template]:')
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
60
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
61 commitMessage=(
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
62 '(-m --message -l --logfile --edit)-e[edit commit message]'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
63 '(-m --message -l --logfile -e)--edit[edit commit message]'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
64 '(-e --edit -l --logfile --message)-m[use <text> as commit message]:message:'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
65 '(-e --edit -l --logfile -m)--message[use <text> as commit message]:message:'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
66 '(-e --edit -m --message --logfile)-l[read the commit message from <file>]:log file:_files'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
67 '(-e --edit -m --message -l)--logfile[read the commit message from <file>]:log file:_files')
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
68
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
69 if [[ $service == "hg" ]]; then
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
70 _arguments -C -A "-*" \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
71 '(--repository)-R[repository root directory]:root:_files -/' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
72 '(-R)--repository[repository root directory]:root:_files -/' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
73 '--cwd[change working directory]:new working directory:_files -/' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
74 '(--noninteractive)-y[do not prompt, assume yes for any required answers]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
75 '(-y)--noninteractive[do not prompt, assume yes for any required answers]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
76 '(--verbose)-v[enable additional output]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
77 '(-v)--verbose[enable additional output]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
78 '(--quiet)-q[suppress output]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
79 '(-q)--quiet[suppress output]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
80 '(--help)-h[display help and exit]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
81 '(-h)--help[display help and exit]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
82 '--debug[debug mode]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
83 '--debugger[start debugger]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
84 '--traceback[print traceback on exception]' \
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
85 '--time[time how long the command takes]' \
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
86 '--profile[profile]' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
87 '--version[output version information and exit]' \
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
88 '*::command:->subcmd' && return 0
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
89
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
90 if (( CURRENT == 1 )); then
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
91 _wanted commands expl 'hg command' compadd -a subcmds
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
92 return
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
93 fi
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
94 service="$words[1]"
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
95 curcontext="${curcontext%:*}=$service:"
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
96 fi
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
97
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
98 case $service in
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
99 (add)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
100 newFiles=(${(ps:\0:)"$(_hg_cmd status -0un .)"})
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
101 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
102 '*:file:->unknown'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
103 _wanted files expl 'unknown files' compadd -a newFiles
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
104 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
105
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
106 (addremove)
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
107 _arguments $includeExclude \
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
108 '*:directories:_files -/' # assume they want to add/remove a dir
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
109 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
110
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
111 (forget)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
112 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0an .)"})
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
113 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
114 '*:file:->added'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
115 _wanted files expl 'newly added files' compadd -a addedFiles
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
116 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
117
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
118 (remove|rm)
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
119 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
120 '*:file:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
121 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
122
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
123 (copy|cp)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
124 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
125 '(--after)-A[record a copy that has already occurred]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
126 '(-A)--after[record a copy that has already occurred]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
127 '(--force)-f[forcibly copy over an existing managed file]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
128 '(-f)--force[forcibly copy over an existing managed file]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
129 '(--parents)-p[append source path to dest]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
130 '(-p)--parents[append source path to dest]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
131 '*:files:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
132 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
133
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
134 (rename|mv)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
135 if (( CURRENT == 2 )); then
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
136 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
137 '(--after)-A[record a rename that has already occurred]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
138 '(-A)--after[record a rename that has already occurred]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
139 '(--force)-f[replace destination if it exists]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
140 '(-F)--force[replace destination if it exists]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
141 '(--parents)-p[append source path to dest]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
142 '(-p)--parents[append source path to dest]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
143 '*:files:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
144 else
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
145 _arguments '*:destination:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
146 fi
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
147 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
148
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
149 (diff)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
150 _arguments $includeExclude \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
151 '*-r[revision]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
152 '*--rev[revision]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
153 '(--text)-a[treat all files as text]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
154 '(-a)--text[treat all files as text]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
155 '*:file:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
156 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
157
1544
b3184bea3eb3 added st as alias for status in zsh_completition
Michael Gebetsroither <michael.geb@gmx.at>
parents: 1486
diff changeset
158 (status|st)
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
159 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
160 '(--no-status)-n[hide status prefix]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
161 '(-n)--no-status[hide status prefix]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
162 '(--print0)-0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
163 '(-0)--print0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
164 '(--modified)-m[show only modified files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
165 '(-m)--modified[show only modified files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
166 '(--added)-a[show only added files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
167 '(-a)--added[show only added files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
168 '(--removed)-r[show only removed files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
169 '(-r)--removed[show only removed files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
170 '(--unknown)-u[show only unknown files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
171 '(-u)--unknown[show only unknown files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
172 '*:search pattern, then files:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
173 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
174
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
175 (revert)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
176 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0amrn .)"})
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
177 _arguments \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
178 '(--rev)-r[revision to revert to]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
179 '(-r)--rev[revision to revert to]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
180 '(--nonrecursive)-n[do not recurse into subdirectories]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
181 '(-n)--nonrecursive[do not recurse into subdirectories]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
182 '*:file:->modified'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
183 _wanted files expl 'mofified files' compadd -a addedFiles
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
184 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
185
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
186 (commit|ci)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
187 addedFiles=(${(ps:\0:)"$(_hg_cmd status -0amrn .)"})
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
188 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
189 '(--addremove)-A[run addremove during commit]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
190 '(-A)--addremove[run addremove during commit]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
191 '(--message)-m[use <txt> as commit message]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
192 '(-m)--message[use <txt> as commit message]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
193 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
194 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
195 '(--date)-d[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
196 '(-d)--date[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
197 '(--user)-u[record user as commiter]:user:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
198 '(-u)--user[record user as commiter]:user:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
199 '*:file:->modified'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
200 _wanted files expl 'mofified files' compadd -a addedFiles
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
201 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
202
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
203 (cat)
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
204 _arguments $includeExclude \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
205 '(--output)-o[print output to file with formatted name]:filespec:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
206 '(-o)--output[print output to file with formatted name]:filespec:' \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
207 '(--rev)-r[revision]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
208 '(-r)--rev[revision]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
209 '*:file:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
210 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
211
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
212 (annotate)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
213 _arguments $includeExclude \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
214 '(--rev)-r[annotate the specified revision]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
215 '(-r)--rev[annotate the specified revision]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
216 '(--text)-a[treat all files as text]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
217 '(-a)--text[treat all files as text]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
218 '(--user)-u[list the author]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
219 '(-u)--user[list the author]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
220 '(--changeset)-c[list the changeset]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
221 '(-c)--changeset[list the changeset]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
222 '(--number)-n[list the revision number (default)]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
223 '(-n)--number[list the revision number (default)]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
224 '*:files:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
225 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
226
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
227 (grep)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
228 _arguments $includeExclude \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
229 '*-r[search in given revision range]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
230 '*--rev[search in given revision range]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
231 '--all[print all revisions with matches]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
232 '(-print0)-0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
233 '(-0)--print0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
234 '(--ignore-case)-i[ignore case when matching]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
235 '(-i)--ignore-case[ignore case when matching]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
236 '(--files-with-matches)-l[print names of files and revs that match]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
237 '(-l)--files-with-matches[print names of files and revs that match]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
238 '(--line-number)-n[print matching line numbers]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
239 '(-n)--line-number[print matching line numbers]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
240 '(--user)-u[print user who committed change]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
241 '(-u)--user[print user who committed change]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
242 '*:search pattern:'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
243 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
244
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
245 (locate)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
246 _arguments $includeExclude \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
247 '(--rev)-r[search repository as it stood at revision]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
248 '(-r)--rev[search repository as it stood at revision]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
249 '(--print0)-0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
250 '(-0)--print0[end filenames with NUL, for use with xargs]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
251 '(--fullpath)-f[print complete paths]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
252 '(-f)--fullpath[print complete paths]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
253 '*:search pattern:'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
254 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
255
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
256 (log|history)
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
257 _arguments $includeExclude $styleOpts \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
258 '*-r[show the specified revision or range]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
259 '*--rev[show the specified revision or range]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
260 '(--no-merges -M --only-merges)-m[show only merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
261 '(--no-merges -M -m)--only-merges[show only merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
262 '(--only-merges -m --no-merges)-M[do not show merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
263 '(--only-merges -m -M)--no-merges[do not show merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
264 '(--keyword)-k[search for a keyword]:keyword:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
265 '(-k)--keyword[search for a keyword]:keyword:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
266 '(--branch)-b[show branches]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
267 '(-b)--branch[show branches]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
268 '(--patch)-p[show patch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
269 '(-p)--patch[show patch]' \
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
270 '*:file:_files'
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
271 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
272
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
273 (update|checkout|co)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
274 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
275 '(--branch)-b[checkout the head of a specific branch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
276 '(-b)--branch[checkout the head of a specific branch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
277 '(-C --clean --merge)-m[allow merging of branches]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
278 '(-C --clean -m)--merge[allow merging of branches]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
279 '(-m --merge --clean)-C[overwrite locally modified files]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
280 '(-m --merge -C)--clean[overwrite locally modified files]' \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
281 '*:revision or tag:->tags'
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
282 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
283
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
284 (tag)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
285 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
286 '(--local)-l[make the tag local]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
287 '(-l)--local[make the tag local]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
288 '(--message)-m[message for tag commit log entry]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
289 '(-m)--message[message for tag commit log entry]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
290 '(--date)-d[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
291 '(-d)--date[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
292 '(--user)-u[record user as commiter]:user:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
293 '(-u)--user[record user as commiter]:user:' \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
294 '*:name, then revision:->tags'
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
295 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
296
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
297 (clone)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
298 if (( CURRENT == 2 )); then
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
299 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') )
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
300 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
301 '(--no-update)-U[do not update the new working directory]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
302 '(-U)--no-update[do not update the new working directory]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
303 '(--ssh)-e[specify ssh command to use]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
304 '(-e)--ssh[specify ssh command to use]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
305 '--pull[use pull protocol to copy metadata]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
306 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
307 '*:local repo:_files -/'
1486
d7809d6e9db2 zsh: allow 'hg clone' to complete paths listed in ~/.hgrc
Steve Borho <steve@borho.org>
parents: 1484
diff changeset
308 _wanted source expl 'source repository' compadd -a repos
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
309 elif (( CURRENT == 3 )); then
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
310 _arguments '*:dest repo:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
311 fi
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
312 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
313
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
314 (rawcommit)
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
315 _arguments \
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
316 '(--parent)-p[parent revision]:revision:->tags' \
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
317 '(-p)--parent[parent revision]:revision:->tags' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
318 '(--date)-d[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
319 '(-d)--date[record datecode as commit date]:date code:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
320 '(--user)-u[record user as commiter]:user:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
321 '(-u)--user[record user as commiter]:user:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
322 '(--message)-m[use <txt> as commit message]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
323 '(-m)--message[use <txt> as commit message]:string:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
324 '(--logfile)-l[read commit message from <file>]:.log file:_file -g \*.txt' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
325 '(-l)--logfile[read commit message from <file>]:.log file:_file -g \*.txt' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
326 '(--files)-F[file list]:file list:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
327 '(-F)--files[file list]:file list:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
328 '*:files to commit:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
329 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
330
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
331 (bundle)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
332 if (( CURRENT == 2 )); then
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
333 _arguments '*:changegroup file:_files -g \*.hg'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
334 elif (( CURRENT == 3 )); then
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
335 _arguments '*:other repo:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
336 fi
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
337 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
338
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
339 (unbundle)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
340 _arguments '*:changegroup .hg file:_files -g \*.hg'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
341 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
342
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
343 (incoming)
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
344 _arguments $styleOpts \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
345 '(--patch)-p[show patch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
346 '(-p)--patch[show patch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
347 '(--no-merges)-M[do not show merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
348 '(-M)--no-merges[do not show merge revisions]' \
1442
d32dbf86b88d zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents: 1438
diff changeset
349 '(--newest-first)-n[show newest record first]' \
d32dbf86b88d zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents: 1438
diff changeset
350 '(-n)--newest-first[show newest record first]' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
351 '*:mercurial repository:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
352 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
353
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
354 (import|patch)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
355 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
356 '(--strip)-p[directory strip option for patch (default: 1)]:count:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
357 '(-p)--strip[directory strip option for patch (default: 1)]:count:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
358 '(--force)-f[skip check for outstanding uncommitted changes]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
359 '(-f)--force[skip check for outstanding uncommitted changes]' \
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
360 '(--base)-b[base directory to read patches from]:file:_files -W $(_hg_cmd root) -/' \
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
361 '(-b)--base[base directory to read patches from]:file:_files -W $(_hg_cmd root) -/' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
362 '*:patch file:_files'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
363 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
364
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
365 (pull)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
366 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') )
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
367 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
368 '(--update)-u[update working directory to tip after pull]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
369 '(-u)--update[update working directory to tip after pull]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
370 '(--ssh)-e[specify ssh command to use]:ssh command:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
371 '(-e)--ssh[specify ssh command to use]:ssh command:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
372 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
373 '*:local repo:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
374 _wanted source expl 'source repository' compadd -a repos
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
375 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
376
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
377 (outgoing)
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
378 _arguments $styleOpts \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
379 '(--patch)-p[show patch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
380 '(-p)--patch[show patch]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
381 '(--no-merges)-M[do not show merge revisions]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
382 '(-M)--no-merges[do not show merge revisions]' \
1442
d32dbf86b88d zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents: 1438
diff changeset
383 '(--newest-first)-n[show newest record first]' \
d32dbf86b88d zsh completion: Added '--newest-first' to incoming, outgoing
Steve Borho <steve@borho.org>
parents: 1438
diff changeset
384 '(-n)--newest-first[show newest record first]' \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
385 '*:local repo:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
386 _wanted source expl 'source repository' compadd -a repos
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
387 ;;
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
388
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
389 (export)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
390 _arguments \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
391 '(--outout)-o[print output to file with formatted name]:filespec:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
392 '(-o)--output[print output to file with formatted name]:filespec:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
393 '(--text)-a[treat all files as text]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
394 '(-a)--text[treat all files as text]' \
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
395 '*:revision:->revs'
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
396 _wanted revs expl 'revision or tag' compadd -a tags
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
397 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
398
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
399 (push)
3497
459e7cd943d4 zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents: 3496
diff changeset
400 repos=( $(_hg_cmd paths | sed -e 's/^.*= //') )
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
401 _arguments \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
402 '(--force)-f[force push]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
403 '(-f)--force[force push]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
404 '(--ssh)-e[specify ssh command to use]:ssh command:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
405 '(-e)--ssh[specify ssh command to use]:ssh command:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
406 '--remotecmd[specify hg command to run on the remote side]:remote hg:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
407 '*:local repo:_files -/'
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
408 _wanted source expl 'source repository' compadd -a repos
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
409 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
410
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
411 (serve)
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
412 _arguments \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
413 '(--accesslog)-A[name of access log file]:log file:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
414 '(-A)--accesslog[name of access log file]:log file:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
415 '(--errorlog)-E[name of error log file]:log file:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
416 '(-E)--errorlog[name of error log file]:log file:_files' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
417 '(--port)-p[listen port]:listen port:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
418 '(-p)--port[listen port]:listen port:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
419 '(--address)-a[interface address]:interface address:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
420 '(-a)--address[interface address]:interface address:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
421 '(--name)-n[name to show in web pages]:repository name:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
422 '(-n)--name[name to show in web pages]:repository name:' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
423 '(--templates)-t[web template directory]:template dir:_files -/' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
424 '(-t)--templates[web template directory]:template dir:_files -/' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
425 '--style[web template style]:style' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
426 '--stdio[for remote clients]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
427 '(--ipv6)-6[use IPv6 in addition to IPv4]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
428 '(-6)--ipv6[use IPv6 in addition to IPv4]'
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
429 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
430
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
431 (help)
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
432 _wanted commands expl 'hg command' compadd -a subcmds
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
433 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
434
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
435 (heads)
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
436 _arguments $styleOpts \
1438
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
437 '(--branches)-b[find branch info]' \
c22da894e4cc zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents: 1368
diff changeset
438 '(-b)--branches[find branch info]'
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
439 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
440
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
441 (paths)
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
442 _arguments '*:symbolic name:(default default-push)'
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
443 ;;
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
444
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
445 (init)
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
446 _arguments '*:new repo directory:_files -/'
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
447 ;;
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
448
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
449 (manifest)
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
450 _arguments '*:revision:->tags'
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
451 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
452
3494
40fabb2a64b8 zsh: add -r to parents
Brendan Cully <brendan@kublai.com>
parents: 3493
diff changeset
453 (par*)
3495
0e80552e1275 zsh: add --style and --template opts
Brendan Cully <brendan@kublai.com>
parents: 3494
diff changeset
454 _arguments $styleOpts \
3494
40fabb2a64b8 zsh: add -r to parents
Brendan Cully <brendan@kublai.com>
parents: 3493
diff changeset
455 '(--rev 1)-r[show parents of the specified rev]:revision:->tags' \
40fabb2a64b8 zsh: add -r to parents
Brendan Cully <brendan@kublai.com>
parents: 3493
diff changeset
456 '(-r 1)--rev[show parents of the specified rev]:revision:->tags' \
40fabb2a64b8 zsh: add -r to parents
Brendan Cully <brendan@kublai.com>
parents: 3493
diff changeset
457 '::revision:->tags'
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
458 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
459
3496
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
460 (identify|recover|root|undo|verify|version|ct|tags)
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
461 # no arguments for these commands
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
462 ;;
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
463
3496
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
464 # HGK
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
465 (vi*)
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
466 _arguments \
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
467 '(--limit)-l[limit number of changes displayed]:' \
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
468 '(-l)--limit[limit number of changes displayed]:' \
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
469 '::revision range:->tags'
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
470 ;;
72b9a3b8bb1d zsh: add view opts
Brendan Cully <brendan@kublai.com>
parents: 3495
diff changeset
471
3487
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
472 # MQ commands
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
473 (qdel*|qrm|qrem*)
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
474 _arguments \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
475 {-k,--keep}'[keep patch file]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
476 {-r,--rev}'[revision]:applied patch:->qapplied' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
477 '*:unapplied patches:->qunapplied'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
478 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
479
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
480 (qnew)
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
481 _arguments $commitMessage \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
482 {-f,--force}'[import uncommitted changes into patch]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
483 ':patch name:'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
484 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
485
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
486 (qpo*)
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
487 _arguments \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
488 (1){-a,--all}'[pop all patches]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
489 {-f,--force}'[forget any local changes]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
490 ':applied patch:->qapplied'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
491 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
492
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
493 (qpu*)
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
494 _arguments \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
495 (1){-a,--all}'[apply all patches]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
496 {-f,--force}'[apply if the patch has rejects]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
497 ':unapplied patch:->qunapplied'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
498 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
499 (qref*)
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
500 _arguments $commitMessage $includeExclude \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
501 {-g,--git}'[use git extended diff format]' \
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
502 {-s,--short}'[short refresh]'
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
503 ;;
46958e428fcd zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents: 1544
diff changeset
504
1368
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
505 (*)
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
506 _message "unknown hg command completion: $service"
d1d605d1e839 Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents: 1365
diff changeset
507 ;;
1362
246e1a00af6f zsh completion function for hg
Steve Borho <steve@borho.org>
parents:
diff changeset
508 esac
3493
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
509
1b9494d2b070 zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents: 3487
diff changeset
510 _hg_state