author | Brendan Cully <brendan@kublai.com> |
Mon, 30 Oct 2006 00:03:04 -0800 | |
changeset 3587 | c8494fcc9d39 |
parent 3560 | 6106236bc4eb |
child 3597 | 0d253ec988a6 |
permissions | -rw-r--r-- |
1362 | 1 |
#compdef hg |
2 |
||
3 |
# Zsh completion script for mercurial. Rename this file to _hg and copy |
|
4 |
# it into your zsh function path (/usr/share/zsh/site-functions for |
|
5 |
# instance) |
|
6 |
# |
|
7 |
# Copyright (C) 2005 Steve Borho |
|
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
8 |
# Copyright (C) 2006 Brendan Cully <brendan@kublai.com> |
1362 | 9 |
# |
10 |
# This is free software; you can redistribute it and/or modify it under |
|
11 |
# the terms of the GNU General Public License as published by the Free |
|
12 |
# Software Foundation; either version 2 of the License, or (at your |
|
13 |
# option) any later version. |
|
14 |
# |
|
15 |
||
16 |
local curcontext="$curcontext" state line |
|
3537 | 17 |
typeset -A _hg_cmd_globals |
18 |
||
19 |
_hg() { |
|
20 |
local cmd |
|
21 |
integer i=2 |
|
22 |
_hg_cmd_globals=() |
|
23 |
||
24 |
while (( i < $#words )) |
|
25 |
do |
|
26 |
case "$words[$i]" in |
|
27 |
-R|--repository|--cwd|--config) |
|
28 |
# pass along arguments to hg completer |
|
29 |
_hg_cmd_globals+="$words[$i]" |
|
30 |
_hg_cmd_globals+="$words[$i+1]" |
|
31 |
(( i += 2 )) |
|
32 |
continue |
|
33 |
;; |
|
34 |
-R*) |
|
35 |
_hg_cmd_globals+="$words[$i]" |
|
36 |
(( i++ )) |
|
37 |
continue |
|
38 |
;; |
|
39 |
-*) |
|
40 |
# skip option |
|
41 |
(( i++ )) |
|
42 |
continue |
|
43 |
;; |
|
44 |
esac |
|
45 |
if [[ -z "$cmd" ]] |
|
46 |
then |
|
47 |
cmd="$words[$i]" |
|
48 |
words[$i]=() |
|
49 |
(( CURRENT-- )) |
|
50 |
fi |
|
51 |
(( i++ )) |
|
52 |
done |
|
53 |
||
54 |
if [[ -z "$cmd" ]] |
|
55 |
then |
|
56 |
_arguments -s -w : $_hg_global_opts \ |
|
57 |
':mercurial command:_hg_commands' |
|
58 |
return |
|
59 |
fi |
|
60 |
||
61 |
# resolve abbreviations and aliases |
|
62 |
if ! (( $+functions[_hg_cmd_${cmd}] )) |
|
63 |
then |
|
64 |
local cmdexp |
|
65 |
(( $#_hg_cmd_list )) || _hg_get_commands |
|
66 |
||
67 |
cmdexp=$_hg_cmd_list[(r)${cmd}*] |
|
68 |
if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]] |
|
69 |
then |
|
70 |
# might be nice to rewrite the command line with the expansion |
|
71 |
cmd="$cmdexp" |
|
72 |
fi |
|
73 |
if [[ -n $_hg_alias_list[$cmd] ]] |
|
74 |
then |
|
75 |
cmd=$_hg_alias_list[$cmd] |
|
76 |
fi |
|
77 |
fi |
|
78 |
||
79 |
if (( $+functions[_hg_cmd_${cmd}] )) |
|
80 |
then |
|
81 |
curcontext="${curcontext%:*:*}:hg-${cmd}:" |
|
82 |
_hg_cmd_${cmd} |
|
83 |
return |
|
84 |
fi |
|
85 |
} |
|
3497
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3496
diff
changeset
|
86 |
|
3537 | 87 |
_hg_get_commands() { |
88 |
typeset -ga _hg_cmd_list |
|
89 |
typeset -gA _hg_alias_list |
|
90 |
local hline cmd cmdalias |
|
91 |
_call_program help hg --verbose help | while read -A hline |
|
92 |
do |
|
93 |
cmd="$hline[1]" |
|
94 |
case $cmd in |
|
95 |
*:) |
|
96 |
cmd=${cmd%:} |
|
97 |
_hg_cmd_list+=($cmd) |
|
98 |
;; |
|
99 |
*,) |
|
100 |
cmd=${cmd%,} |
|
101 |
_hg_cmd_list+=($cmd) |
|
102 |
integer i=2 |
|
103 |
while (( i <= $#hline )) |
|
104 |
do |
|
105 |
cmdalias=${hline[$i]%(:|,)} |
|
106 |
_hg_cmd_list+=($cmdalias) |
|
107 |
_hg_alias_list+=($cmdalias $cmd) |
|
108 |
(( i++ )) |
|
109 |
done |
|
110 |
;; |
|
111 |
esac |
|
112 |
done |
|
113 |
} |
|
114 |
||
115 |
_hg_commands() { |
|
116 |
(( $#_hg_cmd_list )) || _hg_get_commands |
|
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
117 |
_describe -t commands 'mercurial command' _hg_cmd_list |
3537 | 118 |
} |
119 |
||
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
120 |
_hg_revrange() { |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
121 |
compset -P 1 '*:' |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
122 |
_hg_tags "$@" |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
123 |
} |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
124 |
|
3537 | 125 |
_hg_tags() { |
126 |
typeset -a tags |
|
127 |
local tag rev |
|
128 |
||
129 |
_hg_cmd tags 2> /dev/null | while read tag rev |
|
130 |
do |
|
131 |
tags+=($tag) |
|
132 |
done |
|
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
133 |
(( $#tags )) && _describe -t tags 'tags' tags |
3537 | 134 |
} |
135 |
||
136 |
_hg_status() { |
|
3558
733835602365
zsh: suppress error message for status completion outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3550
diff
changeset
|
137 |
status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 . 2>/dev/null)"}) |
3537 | 138 |
} |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
139 |
|
3537 | 140 |
_hg_unknown() { |
141 |
typeset -a status_files |
|
142 |
_hg_status u |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
143 |
_wanted files expl 'unknown files' _multi_parts / status_files |
3537 | 144 |
} |
145 |
||
146 |
_hg_missing() { |
|
147 |
typeset -a status_files |
|
148 |
_hg_status d |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
149 |
_wanted files expl 'missing files' _multi_parts / status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
150 |
} |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
151 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
152 |
_hg_modified() { |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
153 |
typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
154 |
_hg_status m |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
155 |
_wanted files expl 'modified files' _multi_parts / status_files |
3537 | 156 |
} |
157 |
||
158 |
_hg_addremove() { |
|
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
159 |
_alternative 'files:unknown files:_hg_unknown' \ |
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
160 |
'files:missing files:_hg_missing' |
3537 | 161 |
} |
162 |
||
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
163 |
_hg_urls() { |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
164 |
if compset -P bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
165 |
then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
166 |
_files |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
167 |
elif [[ -prefix *: ]] |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
168 |
then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
169 |
_urls |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
170 |
else |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
171 |
local expl |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
172 |
compset -S '[^:]*' |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
173 |
_wanted url-schemas expl 'URL schema' compadd -S '' - \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
174 |
http:// https:// ssh:// bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
175 |
fi |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
176 |
} |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
177 |
|
3537 | 178 |
_hg_paths() { |
179 |
typeset -a paths pnames |
|
180 |
_hg_cmd paths 2> /dev/null | while read -A pnames |
|
181 |
do |
|
182 |
paths+=($pnames[1]) |
|
183 |
done |
|
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
184 |
(( $#paths )) && _describe -t path-aliases 'repository alias' paths |
3537 | 185 |
} |
186 |
||
187 |
_hg_remote() { |
|
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
188 |
_alternative 'path-aliases:repository alias:_hg_paths' \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
189 |
'directories:directory:_files -/' \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
190 |
'urls:URL schema:_hg_urls' |
3537 | 191 |
} |
192 |
||
193 |
# Common options |
|
194 |
_hg_global_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
195 |
'(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
3537 | 196 |
'--cwd[change working directory]:new working directory:_files -/' |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
197 |
'(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
198 |
'(--verbose -v)'{-v,--verbose}'[enable additional output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
199 |
'(--quiet -q)'{-q,--quiet}'[suppress output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
200 |
'(--help -h)'{-h,--help}'[display help and exit]' |
3537 | 201 |
'--debug[debug mode]' |
202 |
'--debugger[start debugger]' |
|
203 |
'--traceback[print traceback on exception]' |
|
204 |
'--time[time how long the command takes]' |
|
205 |
'--profile[profile]' |
|
206 |
'--version[output version information and exit]' |
|
207 |
) |
|
208 |
||
209 |
_hg_pat_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
210 |
'*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
211 |
'*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
3537 | 212 |
|
213 |
_hg_diff_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
214 |
'(--text -a)'{-a,--text}'[treat all files as text]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
215 |
'(--git -g)'{-g,--git}'[use git extended diff format]' |
3537 | 216 |
"--nodates[don't include dates in diff headers]") |
217 |
||
218 |
_hg_dryrun_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
219 |
'(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
3537 | 220 |
|
221 |
_hg_style_opts=( |
|
222 |
'--style[display using template map file]:' |
|
223 |
'--template[display with template]:') |
|
224 |
||
225 |
_hg_commit_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
226 |
'(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
227 |
'(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
228 |
'(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') |
3537 | 229 |
|
230 |
_hg_remote_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
231 |
'(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
3537 | 232 |
'--remotecmd[specify hg command to run on the remote side]:') |
233 |
||
234 |
_hg_cmd() { |
|
235 |
_call_program hg hg "$_hg_cmd_globals[@]" "$@" |
|
236 |
} |
|
237 |
||
238 |
_hg_cmd_add() { |
|
239 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
240 |
'*:unknown files:_hg_unknown' |
|
241 |
} |
|
242 |
||
243 |
_hg_cmd_addremove() { |
|
244 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
245 |
'(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ |
3537 | 246 |
'*:unknown or missing files:_hg_addremove' |
247 |
} |
|
248 |
||
249 |
_hg_cmd_annotate() { |
|
250 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
251 |
'(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
252 |
'(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
253 |
'(--text -a)'{-a,--text}'[treat all files as text]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
254 |
'(--user -u)'{-u,--user}'[list the author]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
255 |
'(--date -d)'{-d,--date}'[list the date]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
256 |
'(--number -n)'{-n,--number}'[list the revision number (default)]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
257 |
'(--changeset -c)'{-c,--changeset}'[list the changeset]' \ |
3537 | 258 |
'*:files:_files -W $(_hg_cmd root)' |
259 |
} |
|
260 |
||
261 |
_hg_cmd_archive() { |
|
262 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
263 |
'--no-decode[do not pass files through decoders]' \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
264 |
'(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
265 |
'(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
266 |
'(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ |
3537 | 267 |
'*:destination:_files' |
268 |
} |
|
269 |
||
270 |
_hg_cmd_bundle() { |
|
271 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
272 |
'(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
3537 | 273 |
'(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ |
274 |
':output file:_files' \ |
|
275 |
':destination repository:_files -/' |
|
276 |
} |
|
277 |
||
278 |
_hg_cmd_cat() { |
|
279 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
280 |
'(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
281 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
3537 | 282 |
'*:file:_files -W $(_hg_cmd root)' |
283 |
} |
|
284 |
||
285 |
_hg_cmd_clone() { |
|
286 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
287 |
'(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
288 |
'(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ |
3537 | 289 |
'--uncompressed[use uncompressed transfer (fast over LAN)]' \ |
290 |
':source repository:_hg_remote' \ |
|
291 |
':destination:_files -/' |
|
292 |
} |
|
293 |
||
294 |
_hg_cmd_commit() { |
|
295 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
296 |
'(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
297 |
'(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
298 |
'(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_file -g \*.txt' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
299 |
'(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
300 |
'(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
3537 | 301 |
'*:file:_files -W $(_hg_cmd root)' |
302 |
} |
|
303 |
||
304 |
_hg_cmd_copy() { |
|
305 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
306 |
'(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
307 |
'(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3537 | 308 |
'*:file:_files -W $(_hg_cmd root)' |
309 |
} |
|
310 |
||
311 |
_hg_cmd_diff() { |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
312 |
typeset -A opt_args |
3537 | 313 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
314 |
'*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
315 |
'(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
316 |
'(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
317 |
'(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
318 |
'(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
319 |
'*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
320 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
321 |
if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
322 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
323 |
if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
324 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
325 |
_files -W $(_hg_cmd root) |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
326 |
else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
327 |
_hg_modified |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
328 |
fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
329 |
fi |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
330 |
} |
1362 | 331 |
|
3537 | 332 |
_hg_cmd_export() { |
333 |
_arguments -s -w : $_hg_global_opts $_hg_diff_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
334 |
'(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
3537 | 335 |
'--switch-parent[diff against the second parent]' \ |
336 |
'*:revision:_hg_tags' |
|
337 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
338 |
|
3537 | 339 |
_hg_cmd_grep() { |
340 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
341 |
'(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ |
3537 | 342 |
'--all[print all revisions with matches]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
343 |
'(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
344 |
'(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
345 |
'(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
346 |
'(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
347 |
'*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
348 |
'(--user -u)'{-u,--user}'[print user who committed change]' \ |
3537 | 349 |
'*:search pattern:_files -W $(_hg_cmd root)' |
350 |
} |
|
1362 | 351 |
|
3537 | 352 |
_hg_cmd_heads() { |
353 |
_arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
354 |
'(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' |
3537 | 355 |
} |
356 |
||
357 |
_hg_cmd_help() { |
|
358 |
_arguments -s -w : $_hg_global_opts \ |
|
359 |
'*:mercurial command:_hg_commands' |
|
360 |
} |
|
1362 | 361 |
|
3537 | 362 |
_hg_cmd_import() { |
363 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
364 |
'(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
365 |
'(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
366 |
'(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ |
3537 | 367 |
'*:patch:_files' |
368 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
369 |
|
3537 | 370 |
_hg_cmd_incoming() { |
371 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
372 |
'(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
373 |
'(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
374 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
375 |
'(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
376 |
'(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 377 |
'--bundle[file to store the bundles into]:bundle file:_files' \ |
378 |
':source:_hg_remote' |
|
379 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
380 |
|
3537 | 381 |
_hg_cmd_init() { |
382 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
383 |
':dir:_files -/' |
|
384 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
385 |
|
3537 | 386 |
_hg_cmd_locate() { |
387 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
388 |
'(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_tags' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
389 |
'(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
390 |
'(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ |
3537 | 391 |
'*:search pattern:_files -W $(_hg_cmd root)' |
392 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
393 |
|
3537 | 394 |
_hg_cmd_log() { |
395 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
396 |
'(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ |
3537 | 397 |
'(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
398 |
'(--copies -C)'{-C,--copies}'[show copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
399 |
'(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
400 |
'(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
401 |
'*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
402 |
'(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
403 |
'(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
404 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
405 |
'(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ |
3537 | 406 |
'*:files:_files -W $(_hg_cmd root)' |
407 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
408 |
|
3537 | 409 |
_hg_cmd_manifest() { |
410 |
_arguments -s -w : $_hg_global_opts \ |
|
411 |
':revision:_hg_tags' |
|
412 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
413 |
|
3537 | 414 |
_hg_cmd_outgoing() { |
415 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
416 |
'(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
417 |
'(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
418 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
419 |
'(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
420 |
'(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 421 |
':destination:_hg_remote' |
422 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
423 |
|
3537 | 424 |
_hg_cmd_parents() { |
425 |
_arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
426 |
'(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ |
3537 | 427 |
':revision:_hg_tags' |
428 |
} |
|
429 |
||
430 |
_hg_cmd_paths() { |
|
431 |
_arguments -s -w : $_hg_global_opts \ |
|
432 |
':path:_hg_paths' |
|
433 |
} |
|
434 |
||
435 |
_hg_cmd_pull() { |
|
436 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
437 |
'(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
438 |
'(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ |
3537 | 439 |
':source:_hg_remote' |
440 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
441 |
|
3537 | 442 |
_hg_cmd_push() { |
443 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
444 |
'(--force -f)'{-f,--force}'[force push]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
445 |
'(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ |
3537 | 446 |
':destination:_hg_remote' |
447 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
448 |
|
3537 | 449 |
_hg_cmd_remove() { |
450 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
451 |
'(--after -A)'{-A,--after}'[record remove that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
452 |
'(--force -f)'{-f,--force}'[remove file even if modified]' \ |
3537 | 453 |
'*:file:_files -W $(_hg_cmd root)' |
454 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
455 |
|
3537 | 456 |
_hg_cmd_rename() { |
457 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
458 |
'(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
459 |
'(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3537 | 460 |
'*:file:_files -W $(_hg_cmd root)' |
461 |
} |
|
1362 | 462 |
|
3537 | 463 |
_hg_cmd_revert() { |
464 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
465 |
'(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
466 |
'(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ |
3537 | 467 |
'--no-backup[do not save backup copies of files]' \ |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
468 |
'*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
469 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
470 |
if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
471 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
472 |
if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
473 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
474 |
_files -W $(_hg_cmd root) |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
475 |
else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
476 |
typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
477 |
_hg_status mard |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
478 |
_wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
479 |
fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
480 |
fi |
3537 | 481 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
482 |
|
3537 | 483 |
_hg_cmd_serve() { |
484 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
485 |
'(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
486 |
'(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
487 |
'(--daemon -d)'{-d,--daemon}'[run server in background]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
488 |
'(--port -p)'{-p+,--port}'[listen port]:listen port:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
489 |
'(--address -a)'{-a+,--address}'[interface address]:interface address:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
490 |
'(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
491 |
'(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ |
3537 | 492 |
'--style[web template style]:style' \ |
493 |
'--stdio[for remote clients]' \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
494 |
'(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' |
3537 | 495 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
496 |
|
3537 | 497 |
_hg_cmd_status() { |
498 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
499 |
'(--all -A)'{-A,--all}'[show status of all files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
500 |
'(--modified -m)'{-m,--modified}'[show only modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
501 |
'(--added -a)'{-a,--added}'[show only added files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
502 |
'(--removed -r)'{-r,--removed}'[show only removed files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
503 |
'(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
504 |
'(--clean -c)'{-c,--clean}'[show only files without changes]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
505 |
'(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
506 |
'(--ignored -i)'{-i,--ignored}'[show ignored files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
507 |
'(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
508 |
'(--copies -C)'{-C,--copies}'[show source of copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
509 |
'(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
3537 | 510 |
'--rev[show difference from revision]:revision:_hg_tags' \ |
511 |
'*:files:_files' |
|
512 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
513 |
|
3537 | 514 |
_hg_cmd_tag() { |
515 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
516 |
'(--local -l)'{-l,--local}'[make the tag local]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
517 |
'(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
518 |
'(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
519 |
'(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
520 |
'(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ |
3537 | 521 |
':tag name:' |
522 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
523 |
|
3537 | 524 |
_hg_cmd_tip() { |
525 |
_arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
526 |
'(--patch -p)'{-p,--patch}'[show patch]' |
3537 | 527 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
528 |
|
3537 | 529 |
_hg_cmd_unbundle() { |
530 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
531 |
'(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ |
3537 | 532 |
':files:_files' |
533 |
} |
|
1362 | 534 |
|
3537 | 535 |
_hg_cmd_update() { |
536 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
537 |
'(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
538 |
'(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ |
3537 | 539 |
':revision:_hg_tags' |
540 |
} |
|
1362 | 541 |
|
3537 | 542 |
# HGK |
543 |
_hg_cmd_view() { |
|
544 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
545 |
'(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3537 | 546 |
':revision range:_hg_tags' |
547 |
} |
|
1362 | 548 |
|
3537 | 549 |
# MQ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
550 |
_hg_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
551 |
typeset -a patches |
3559
35b99f076d02
zsh: suppress mq completion error messages outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3558
diff
changeset
|
552 |
patches=($(_hg_cmd qseries 2>/dev/null)) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
553 |
(( $#patches )) && _describe -t hg-patches 'patches' patches |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
554 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
555 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
556 |
_hg_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
557 |
typeset -a patches |
3559
35b99f076d02
zsh: suppress mq completion error messages outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3558
diff
changeset
|
558 |
patches=($(_hg_cmd qapplied 2>/dev/null)) |
3549
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
559 |
if (( $#patches )) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
560 |
then |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
561 |
patches+=(qbase qtip) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
562 |
_describe -t hg-applied-patches 'applied patches' patches |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
563 |
fi |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
564 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
565 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
566 |
_hg_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
567 |
typeset -a patches |
3559
35b99f076d02
zsh: suppress mq completion error messages outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3558
diff
changeset
|
568 |
patches=($(_hg_cmd qunapplied 2>/dev/null)) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
569 |
(( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
570 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
571 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
572 |
_hg_qguards() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
573 |
typeset -a guards |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
574 |
local guard |
3543
fe9c1e886b5e
zsh: complete qguard with +/- guard prefixes
Brendan Cully <brendan@kublai.com>
parents:
3541
diff
changeset
|
575 |
compset -P "+|-" |
3559
35b99f076d02
zsh: suppress mq completion error messages outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3558
diff
changeset
|
576 |
_hg_cmd qselect -s 2>/dev/null | while read guard |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
577 |
do |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
578 |
guards+=(${guard#(+|-)}) |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
579 |
done |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
580 |
(( $#guards )) && _describe -t hg-guards 'guards' guards |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
581 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
582 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
583 |
_hg_qseries_opts=( |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
584 |
'(--summary -s)'{-s,--summary}'[print first line of patch header]') |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
585 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
586 |
_hg_cmd_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
587 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
588 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
589 |
|
3537 | 590 |
_hg_cmd_qdelete() { |
591 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
592 |
'(--keep -k)'{-k,--keep}'[keep patch file]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
593 |
'*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
594 |
'*:unapplied patch:_hg_qunapplied' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
595 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
596 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
597 |
_hg_cmd_qdiff() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
598 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
599 |
'*:pattern:_files -W $(_hg_cmd root)' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
600 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
601 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
602 |
_hg_cmd_qfold() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
603 |
_arguments -s -w : $_hg_global_opts $_h_commit_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
604 |
'(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
605 |
'*:unapplied patch:_hg_qunapplied' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
606 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
607 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
608 |
_hg_cmd_qguard() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
609 |
_arguments -s -w : $_hg_global_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
610 |
'(--list -l)'{-l,--list}'[list all patches and guards]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
611 |
'(--none -n)'{-n,--none}'[drop all guards]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
612 |
':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
613 |
'*:guards:_hg_qguards' |
3537 | 614 |
} |
1362 | 615 |
|
3537 | 616 |
_hg_cmd_qheader() { |
617 |
_arguments -s -w : $_hg_global_opts \ |
|
618 |
':patch:_hg_qseries' |
|
619 |
} |
|
1362 | 620 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
621 |
_hg_cmd_qimport() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
622 |
_arguments -s -w : $_hg_global_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
623 |
'(--existing -e)'{-e,--existing}'[import file in patch dir]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
624 |
'(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
625 |
'(--force -f)'{-f,--force}'[overwrite existing files]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
626 |
'*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
627 |
'*:patch:_files' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
628 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
629 |
|
3537 | 630 |
_hg_cmd_qnew() { |
631 |
_arguments -s -w : $_hg_global_opts $_hg_commit_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
632 |
'(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
3537 | 633 |
':patch:' |
634 |
} |
|
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
635 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
636 |
_hg_cmd_qnext() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
637 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
638 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
639 |
|
3537 | 640 |
_hg_cmd_qpop() { |
641 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
642 |
'(--all -a :)'{-a,--all}'[pop all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
643 |
'(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
644 |
'(--force -f)'{-f,--force}'[forget any local changes]' \ |
3537 | 645 |
':patch:_hg_qapplied' |
646 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
647 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
648 |
_hg_cmd_qprev() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
649 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
650 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
651 |
|
3537 | 652 |
_hg_cmd_qpush() { |
653 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
654 |
'(--all -a :)'{-a,--all}'[apply all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
655 |
'(--list -l)'{-l,--list}'[list patch name in commit text]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
656 |
'(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
657 |
'(--name -n)'{-n+,--name}'[merge queue name]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
658 |
'(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
3537 | 659 |
':patch:_hg_qunapplied' |
660 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
661 |
|
3537 | 662 |
_hg_cmd_qrefresh() { |
663 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
664 |
'(--git -g)'{-g,--git}'[use git extended diff format]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
665 |
'(--short -s)'{-s,--short}'[short refresh]' \ |
3537 | 666 |
'*:files:_files -W $(_hg_cmd root)' |
667 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
668 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
669 |
_hg_cmd_qrename() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
670 |
_arguments -s -w : $_hg_global_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
671 |
':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
672 |
':destination:' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
673 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
674 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
675 |
_hg_cmd_qselect() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
676 |
_arguments -s -w : $_hg_global_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
677 |
'(--none -n :)'{-n,--none}'[disable all guards]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
678 |
'(--series -s :)'{-s,--series}'[list all guards in series file]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
679 |
'--pop[pop to before first guarded applied patch]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
680 |
'--reapply[pop and reapply patches]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
681 |
'*:guards:_hg_qguards' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
682 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
683 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
684 |
_hg_cmd_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
685 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
686 |
'(--missing -m)'{-m,--missing}'[print patches not in series]' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
687 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
688 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
689 |
_hg_cmd_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
690 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
691 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
692 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
693 |
_hg_cmd_qtop() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
694 |
_arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
695 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
696 |
|
3537 | 697 |
_hg_cmd_strip() { |
698 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
699 |
'(--force -f)'{-f,--force}'[force multi-head removal]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
700 |
'(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
701 |
'(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
3537 | 702 |
':revision:_hg_tags' |
703 |
} |
|
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
704 |
|
3537 | 705 |
_hg "$@" |