##// END OF EJS Templates
zsh completion: add support for convert, graphlog, purge, record extensions
Nikolaj Sjujskij -
r17400:3ae4da1c default
parent child Browse files
Show More
@@ -1,1122 +1,1167 b''
1 #compdef hg
1 #compdef hg
2
2
3 # Zsh completion script for mercurial. Rename this file to _hg and copy
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
4 # it into your zsh function path (/usr/share/zsh/site-functions for
5 # instance)
5 # instance)
6 #
6 #
7 # If you do not want to install it globally, you can copy it somewhere
7 # If you do not want to install it globally, you can copy it somewhere
8 # else and add that directory to $fpath. This must be done before
8 # else and add that directory to $fpath. This must be done before
9 # compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc
9 # compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc
10 # file could look like this:
10 # file could look like this:
11 #
11 #
12 # fpath=("$HOME/.zsh.d" $fpath)
12 # fpath=("$HOME/.zsh.d" $fpath)
13 # autoload -U compinit
13 # autoload -U compinit
14 # compinit
14 # compinit
15 #
15 #
16 # Copyright (C) 2005, 2006 Steve Borho <steve@borho.org>
16 # Copyright (C) 2005, 2006 Steve Borho <steve@borho.org>
17 # Copyright (C) 2006-10 Brendan Cully <brendan@kublai.com>
17 # Copyright (C) 2006-10 Brendan Cully <brendan@kublai.com>
18 #
18 #
19 # Permission is hereby granted, without written agreement and without
19 # Permission is hereby granted, without written agreement and without
20 # licence or royalty fees, to use, copy, modify, and distribute this
20 # licence or royalty fees, to use, copy, modify, and distribute this
21 # software and to distribute modified versions of this software for any
21 # software and to distribute modified versions of this software for any
22 # purpose, provided that the above copyright notice and the following
22 # purpose, provided that the above copyright notice and the following
23 # two paragraphs appear in all copies of this software.
23 # two paragraphs appear in all copies of this software.
24 #
24 #
25 # In no event shall the authors be liable to any party for direct,
25 # In no event shall the authors be liable to any party for direct,
26 # indirect, special, incidental, or consequential damages arising out of
26 # indirect, special, incidental, or consequential damages arising out of
27 # the use of this software and its documentation, even if the authors
27 # the use of this software and its documentation, even if the authors
28 # have been advised of the possibility of such damage.
28 # have been advised of the possibility of such damage.
29 #
29 #
30 # The authors specifically disclaim any warranties, including, but not
30 # The authors specifically disclaim any warranties, including, but not
31 # limited to, the implied warranties of merchantability and fitness for
31 # limited to, the implied warranties of merchantability and fitness for
32 # a particular purpose. The software provided hereunder is on an "as
32 # a particular purpose. The software provided hereunder is on an "as
33 # is" basis, and the authors have no obligation to provide maintenance,
33 # is" basis, and the authors have no obligation to provide maintenance,
34 # support, updates, enhancements, or modifications.
34 # support, updates, enhancements, or modifications.
35
35
36 emulate -LR zsh
36 emulate -LR zsh
37 setopt extendedglob
37 setopt extendedglob
38
38
39 local curcontext="$curcontext" state line
39 local curcontext="$curcontext" state line
40 typeset -A _hg_cmd_globals
40 typeset -A _hg_cmd_globals
41
41
42 _hg() {
42 _hg() {
43 local cmd _hg_root
43 local cmd _hg_root
44 integer i=2
44 integer i=2
45 _hg_cmd_globals=()
45 _hg_cmd_globals=()
46
46
47 while (( i < $#words ))
47 while (( i < $#words ))
48 do
48 do
49 case "$words[$i]" in
49 case "$words[$i]" in
50 -R|--repository)
50 -R|--repository)
51 eval _hg_root="$words[$i+1]"
51 eval _hg_root="$words[$i+1]"
52 _hg_cmd_globals+=("$words[$i]" "$_hg_root")
52 _hg_cmd_globals+=("$words[$i]" "$_hg_root")
53 (( i += 2 ))
53 (( i += 2 ))
54 continue
54 continue
55 ;;
55 ;;
56 -R*)
56 -R*)
57 _hg_cmd_globals+="$words[$i]"
57 _hg_cmd_globals+="$words[$i]"
58 eval _hg_root="${words[$i]#-R}"
58 eval _hg_root="${words[$i]#-R}"
59 (( i++ ))
59 (( i++ ))
60 continue
60 continue
61 ;;
61 ;;
62 --cwd|--config)
62 --cwd|--config)
63 # pass along arguments to hg completer
63 # pass along arguments to hg completer
64 _hg_cmd_globals+=("$words[$i]" "$words[$i+1]")
64 _hg_cmd_globals+=("$words[$i]" "$words[$i+1]")
65 (( i += 2 ))
65 (( i += 2 ))
66 continue
66 continue
67 ;;
67 ;;
68 -*)
68 -*)
69 # skip option
69 # skip option
70 (( i++ ))
70 (( i++ ))
71 continue
71 continue
72 ;;
72 ;;
73 esac
73 esac
74 if [[ -z "$cmd" ]]
74 if [[ -z "$cmd" ]]
75 then
75 then
76 cmd="$words[$i]"
76 cmd="$words[$i]"
77 words[$i]=()
77 words[$i]=()
78 (( CURRENT-- ))
78 (( CURRENT-- ))
79 fi
79 fi
80 (( i++ ))
80 (( i++ ))
81 done
81 done
82
82
83 if [[ -z "$cmd" ]]
83 if [[ -z "$cmd" ]]
84 then
84 then
85 _arguments -s -w : $_hg_global_opts \
85 _arguments -s -w : $_hg_global_opts \
86 ':mercurial command:_hg_commands'
86 ':mercurial command:_hg_commands'
87 return
87 return
88 fi
88 fi
89
89
90 # resolve abbreviations and aliases
90 # resolve abbreviations and aliases
91 if ! (( $+functions[_hg_cmd_${cmd}] ))
91 if ! (( $+functions[_hg_cmd_${cmd}] ))
92 then
92 then
93 local cmdexp
93 local cmdexp
94 (( $#_hg_cmd_list )) || _hg_get_commands
94 (( $#_hg_cmd_list )) || _hg_get_commands
95
95
96 cmdexp=$_hg_cmd_list[(r)${cmd}*]
96 cmdexp=$_hg_cmd_list[(r)${cmd}*]
97 if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]]
97 if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]]
98 then
98 then
99 # might be nice to rewrite the command line with the expansion
99 # might be nice to rewrite the command line with the expansion
100 cmd="$cmdexp"
100 cmd="$cmdexp"
101 fi
101 fi
102 if [[ -n $_hg_alias_list[$cmd] ]]
102 if [[ -n $_hg_alias_list[$cmd] ]]
103 then
103 then
104 cmd=$_hg_alias_list[$cmd]
104 cmd=$_hg_alias_list[$cmd]
105 fi
105 fi
106 fi
106 fi
107
107
108 curcontext="${curcontext%:*:*}:hg-${cmd}:"
108 curcontext="${curcontext%:*:*}:hg-${cmd}:"
109
109
110 zstyle -s ":completion:$curcontext:" cache-policy update_policy
110 zstyle -s ":completion:$curcontext:" cache-policy update_policy
111
111
112 if [[ -z "$update_policy" ]]
112 if [[ -z "$update_policy" ]]
113 then
113 then
114 zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy
114 zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy
115 fi
115 fi
116
116
117 if (( $+functions[_hg_cmd_${cmd}] ))
117 if (( $+functions[_hg_cmd_${cmd}] ))
118 then
118 then
119 _hg_cmd_${cmd}
119 _hg_cmd_${cmd}
120 else
120 else
121 # complete unknown commands normally
121 # complete unknown commands normally
122 _arguments -s -w : $_hg_global_opts \
122 _arguments -s -w : $_hg_global_opts \
123 '*:files:_hg_files'
123 '*:files:_hg_files'
124 fi
124 fi
125 }
125 }
126
126
127 _hg_cache_policy() {
127 _hg_cache_policy() {
128 typeset -a old
128 typeset -a old
129
129
130 # cache for a minute
130 # cache for a minute
131 old=( "$1"(mm+10) )
131 old=( "$1"(mm+10) )
132 (( $#old )) && return 0
132 (( $#old )) && return 0
133
133
134 return 1
134 return 1
135 }
135 }
136
136
137 _hg_get_commands() {
137 _hg_get_commands() {
138 typeset -ga _hg_cmd_list
138 typeset -ga _hg_cmd_list
139 typeset -gA _hg_alias_list
139 typeset -gA _hg_alias_list
140 local hline cmd cmdalias
140 local hline cmd cmdalias
141
141
142 _call_program hg hg debugcomplete -v | while read -A hline
142 _call_program hg hg debugcomplete -v | while read -A hline
143 do
143 do
144 cmd=$hline[1]
144 cmd=$hline[1]
145 _hg_cmd_list+=($cmd)
145 _hg_cmd_list+=($cmd)
146
146
147 for cmdalias in $hline[2,-1]
147 for cmdalias in $hline[2,-1]
148 do
148 do
149 _hg_cmd_list+=($cmdalias)
149 _hg_cmd_list+=($cmdalias)
150 _hg_alias_list+=($cmdalias $cmd)
150 _hg_alias_list+=($cmdalias $cmd)
151 done
151 done
152 done
152 done
153 }
153 }
154
154
155 _hg_commands() {
155 _hg_commands() {
156 (( $#_hg_cmd_list )) || _hg_get_commands
156 (( $#_hg_cmd_list )) || _hg_get_commands
157 _describe -t commands 'mercurial command' _hg_cmd_list
157 _describe -t commands 'mercurial command' _hg_cmd_list
158 }
158 }
159
159
160 _hg_revrange() {
160 _hg_revrange() {
161 compset -P 1 '*:'
161 compset -P 1 '*:'
162 _hg_labels "$@"
162 _hg_labels "$@"
163 }
163 }
164
164
165 _hg_labels() {
165 _hg_labels() {
166 _hg_tags "$@"
166 _hg_tags "$@"
167 _hg_bookmarks "$@"
167 _hg_bookmarks "$@"
168 _hg_branches "$@"
168 _hg_branches "$@"
169 }
169 }
170
170
171 _hg_tags() {
171 _hg_tags() {
172 typeset -a tags
172 typeset -a tags
173 local tag rev
173 local tag rev
174
174
175 _hg_cmd tags | while read tag
175 _hg_cmd tags | while read tag
176 do
176 do
177 tags+=(${tag/ # [0-9]#:*})
177 tags+=(${tag/ # [0-9]#:*})
178 done
178 done
179 (( $#tags )) && _describe -t tags 'tags' tags
179 (( $#tags )) && _describe -t tags 'tags' tags
180 }
180 }
181
181
182 _hg_bookmarks() {
182 _hg_bookmarks() {
183 typeset -a bookmark bookmarks
183 typeset -a bookmark bookmarks
184
184
185 _hg_cmd bookmarks | while read -A bookmark
185 _hg_cmd bookmarks | while read -A bookmark
186 do
186 do
187 if test -z ${bookmark[-1]:#[0-9]*}
187 if test -z ${bookmark[-1]:#[0-9]*}
188 then
188 then
189 bookmarks+=($bookmark[-2])
189 bookmarks+=($bookmark[-2])
190 fi
190 fi
191 done
191 done
192 (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks
192 (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks
193 }
193 }
194
194
195 _hg_branches() {
195 _hg_branches() {
196 typeset -a branches
196 typeset -a branches
197 local branch
197 local branch
198
198
199 _hg_cmd branches | while read branch
199 _hg_cmd branches | while read branch
200 do
200 do
201 branches+=(${branch/ # [0-9]#:*})
201 branches+=(${branch/ # [0-9]#:*})
202 done
202 done
203 (( $#branches )) && _describe -t branches 'branches' branches
203 (( $#branches )) && _describe -t branches 'branches' branches
204 }
204 }
205
205
206 # likely merge candidates
206 # likely merge candidates
207 _hg_mergerevs() {
207 _hg_mergerevs() {
208 typeset -a heads
208 typeset -a heads
209 local myrev
209 local myrev
210
210
211 heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"})
211 heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"})
212 # exclude own revision
212 # exclude own revision
213 myrev=$(_hg_cmd log -r . --template '{rev}\\n')
213 myrev=$(_hg_cmd log -r . --template '{rev}\\n')
214 heads=(${heads:#$myrev})
214 heads=(${heads:#$myrev})
215
215
216 (( $#heads )) && _describe -t heads 'heads' heads
216 (( $#heads )) && _describe -t heads 'heads' heads
217 }
217 }
218
218
219 _hg_files() {
219 _hg_files() {
220 if [[ -n "$_hg_root" ]]
220 if [[ -n "$_hg_root" ]]
221 then
221 then
222 [[ -d "$_hg_root/.hg" ]] || return
222 [[ -d "$_hg_root/.hg" ]] || return
223 case "$_hg_root" in
223 case "$_hg_root" in
224 /*)
224 /*)
225 _files -W $_hg_root
225 _files -W $_hg_root
226 ;;
226 ;;
227 *)
227 *)
228 _files -W $PWD/$_hg_root
228 _files -W $PWD/$_hg_root
229 ;;
229 ;;
230 esac
230 esac
231 else
231 else
232 _files
232 _files
233 fi
233 fi
234 }
234 }
235
235
236 _hg_status() {
236 _hg_status() {
237 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
237 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
238 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"})
238 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"})
239 }
239 }
240
240
241 _hg_unknown() {
241 _hg_unknown() {
242 typeset -a status_files
242 typeset -a status_files
243 _hg_status u
243 _hg_status u
244 _wanted files expl 'unknown files' _multi_parts / status_files
244 _wanted files expl 'unknown files' _multi_parts / status_files
245 }
245 }
246
246
247 _hg_missing() {
247 _hg_missing() {
248 typeset -a status_files
248 typeset -a status_files
249 _hg_status d
249 _hg_status d
250 _wanted files expl 'missing files' _multi_parts / status_files
250 _wanted files expl 'missing files' _multi_parts / status_files
251 }
251 }
252
252
253 _hg_modified() {
253 _hg_modified() {
254 typeset -a status_files
254 typeset -a status_files
255 _hg_status m
255 _hg_status m
256 _wanted files expl 'modified files' _multi_parts / status_files
256 _wanted files expl 'modified files' _multi_parts / status_files
257 }
257 }
258
258
259 _hg_resolve() {
259 _hg_resolve() {
260 local rstate rpath
260 local rstate rpath
261
261
262 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
262 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h
263
263
264 _hg_cmd resolve -l ./$PREFIX | while read rstate rpath
264 _hg_cmd resolve -l ./$PREFIX | while read rstate rpath
265 do
265 do
266 [[ $rstate == 'R' ]] && resolved_files+=($rpath)
266 [[ $rstate == 'R' ]] && resolved_files+=($rpath)
267 [[ $rstate == 'U' ]] && unresolved_files+=($rpath)
267 [[ $rstate == 'U' ]] && unresolved_files+=($rpath)
268 done
268 done
269 }
269 }
270
270
271 _hg_resolved() {
271 _hg_resolved() {
272 typeset -a resolved_files unresolved_files
272 typeset -a resolved_files unresolved_files
273 _hg_resolve
273 _hg_resolve
274 _wanted files expl 'resolved files' _multi_parts / resolved_files
274 _wanted files expl 'resolved files' _multi_parts / resolved_files
275 }
275 }
276
276
277 _hg_unresolved() {
277 _hg_unresolved() {
278 typeset -a resolved_files unresolved_files
278 typeset -a resolved_files unresolved_files
279 _hg_resolve
279 _hg_resolve
280 _wanted files expl 'unresolved files' _multi_parts / unresolved_files
280 _wanted files expl 'unresolved files' _multi_parts / unresolved_files
281 }
281 }
282
282
283 _hg_config() {
283 _hg_config() {
284 typeset -a items
284 typeset -a items
285 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*})
285 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*})
286 (( $#items )) && _describe -t config 'config item' items
286 (( $#items )) && _describe -t config 'config item' items
287 }
287 }
288
288
289 _hg_addremove() {
289 _hg_addremove() {
290 _alternative 'files:unknown files:_hg_unknown' \
290 _alternative 'files:unknown files:_hg_unknown' \
291 'files:missing files:_hg_missing'
291 'files:missing files:_hg_missing'
292 }
292 }
293
293
294 _hg_ssh_urls() {
294 _hg_ssh_urls() {
295 if [[ -prefix */ ]]
295 if [[ -prefix */ ]]
296 then
296 then
297 if zstyle -T ":completion:${curcontext}:files" remote-access
297 if zstyle -T ":completion:${curcontext}:files" remote-access
298 then
298 then
299 local host=${PREFIX%%/*}
299 local host=${PREFIX%%/*}
300 typeset -a remdirs
300 typeset -a remdirs
301 compset -p $(( $#host + 1 ))
301 compset -p $(( $#host + 1 ))
302 local rempath=${(M)PREFIX##*/}
302 local rempath=${(M)PREFIX##*/}
303 local cacheid="hg:${host}-${rempath//\//_}"
303 local cacheid="hg:${host}-${rempath//\//_}"
304 cacheid=${cacheid%[-_]}
304 cacheid=${cacheid%[-_]}
305 compset -P '*/'
305 compset -P '*/'
306 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid"
306 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid"
307 then
307 then
308 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/})
308 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/})
309 _store_cache "$cacheid" remdirs
309 _store_cache "$cacheid" remdirs
310 fi
310 fi
311 _describe -t directories 'remote directory' remdirs -S/
311 _describe -t directories 'remote directory' remdirs -S/
312 else
312 else
313 _message 'remote directory'
313 _message 'remote directory'
314 fi
314 fi
315 else
315 else
316 if compset -P '*@'
316 if compset -P '*@'
317 then
317 then
318 _hosts -S/
318 _hosts -S/
319 else
319 else
320 _alternative 'hosts:remote host name:_hosts -S/' \
320 _alternative 'hosts:remote host name:_hosts -S/' \
321 'users:user:_users -S@'
321 'users:user:_users -S@'
322 fi
322 fi
323 fi
323 fi
324 }
324 }
325
325
326 _hg_urls() {
326 _hg_urls() {
327 if compset -P bundle://
327 if compset -P bundle://
328 then
328 then
329 _files
329 _files
330 elif compset -P ssh://
330 elif compset -P ssh://
331 then
331 then
332 _hg_ssh_urls
332 _hg_ssh_urls
333 elif [[ -prefix *: ]]
333 elif [[ -prefix *: ]]
334 then
334 then
335 _urls
335 _urls
336 else
336 else
337 local expl
337 local expl
338 compset -S '[^:]*'
338 compset -S '[^:]*'
339 _wanted url-schemas expl 'URL schema' compadd -S '' - \
339 _wanted url-schemas expl 'URL schema' compadd -S '' - \
340 http:// https:// ssh:// bundle://
340 http:// https:// ssh:// bundle://
341 fi
341 fi
342 }
342 }
343
343
344 _hg_paths() {
344 _hg_paths() {
345 typeset -a paths pnames
345 typeset -a paths pnames
346 _hg_cmd paths | while read -A pnames
346 _hg_cmd paths | while read -A pnames
347 do
347 do
348 paths+=($pnames[1])
348 paths+=($pnames[1])
349 done
349 done
350 (( $#paths )) && _describe -t path-aliases 'repository alias' paths
350 (( $#paths )) && _describe -t path-aliases 'repository alias' paths
351 }
351 }
352
352
353 _hg_remote() {
353 _hg_remote() {
354 _alternative 'path-aliases:repository alias:_hg_paths' \
354 _alternative 'path-aliases:repository alias:_hg_paths' \
355 'directories:directory:_files -/' \
355 'directories:directory:_files -/' \
356 'urls:URL:_hg_urls'
356 'urls:URL:_hg_urls'
357 }
357 }
358
358
359 _hg_clone_dest() {
359 _hg_clone_dest() {
360 _alternative 'directories:directory:_files -/' \
360 _alternative 'directories:directory:_files -/' \
361 'urls:URL:_hg_urls'
361 'urls:URL:_hg_urls'
362 }
362 }
363
363
364 _hg_add_help_topics=(
364 _hg_add_help_topics=(
365 config dates diffs environment extensions filesets glossary hgignore hgweb
365 config dates diffs environment extensions filesets glossary hgignore hgweb
366 merge-tools multirevs obsolescence patterns phases revisions revsets
366 merge-tools multirevs obsolescence patterns phases revisions revsets
367 subrepos templating urls
367 subrepos templating urls
368 )
368 )
369
369
370 _hg_help_topics() {
370 _hg_help_topics() {
371 local topics
371 local topics
372 (( $#_hg_cmd_list )) || _hg_get_commands
372 (( $#_hg_cmd_list )) || _hg_get_commands
373 topics=($_hg_cmd_list $_hg_add_help_topics)
373 topics=($_hg_cmd_list $_hg_add_help_topics)
374 _describe -t help_topics 'help topics' topics
374 _describe -t help_topics 'help topics' topics
375 }
375 }
376
376
377 # Common options
377 # Common options
378 _hg_global_opts=(
378 _hg_global_opts=(
379 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/'
379 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/'
380 '--cwd[change working directory]:new working directory:_files -/'
380 '--cwd[change working directory]:new working directory:_files -/'
381 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]'
381 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]'
382 '(--verbose -v)'{-v,--verbose}'[enable additional output]'
382 '(--verbose -v)'{-v,--verbose}'[enable additional output]'
383 '*--config[set/override config option]:defined config items:_hg_config'
383 '*--config[set/override config option]:defined config items:_hg_config'
384 '(--quiet -q)'{-q,--quiet}'[suppress output]'
384 '(--quiet -q)'{-q,--quiet}'[suppress output]'
385 '(--help -h)'{-h,--help}'[display help and exit]'
385 '(--help -h)'{-h,--help}'[display help and exit]'
386 '--debug[debug mode]'
386 '--debug[debug mode]'
387 '--debugger[start debugger]'
387 '--debugger[start debugger]'
388 '--encoding[set the charset encoding]'
388 '--encoding[set the charset encoding]'
389 '--encodingmode[set the charset encoding mode]'
389 '--encodingmode[set the charset encoding mode]'
390 '--lsprof[print improved command execution profile]'
390 '--lsprof[print improved command execution profile]'
391 '--traceback[print traceback on exception]'
391 '--traceback[print traceback on exception]'
392 '--time[time how long the command takes]'
392 '--time[time how long the command takes]'
393 '--profile[profile]'
393 '--profile[profile]'
394 '--version[output version information and exit]'
394 '--version[output version information and exit]'
395 )
395 )
396
396
397 _hg_pat_opts=(
397 _hg_pat_opts=(
398 '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
398 '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
399 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
399 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
400
400
401 _hg_clone_opts=(
401 _hg_clone_opts=(
402 $_hg_remote_opts
402 $_hg_remote_opts
403 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]'
403 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]'
404 '--pull[use pull protocol to copy metadata]'
404 '--pull[use pull protocol to copy metadata]'
405 '--uncompressed[use uncompressed transfer (fast over LAN)]')
405 '--uncompressed[use uncompressed transfer (fast over LAN)]')
406
406
407 _hg_date_user_opts=(
407 _hg_date_user_opts=(
408 '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]'
408 '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]'
409 '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]'
409 '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]'
410 '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:'
410 '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:'
411 '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:')
411 '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:')
412
412
413 _hg_gitlike_opts=(
413 _hg_gitlike_opts=(
414 '(--git -g)'{-g,--git}'[use git extended diff format]')
414 '(--git -g)'{-g,--git}'[use git extended diff format]')
415
415
416 _hg_diff_opts=(
416 _hg_diff_opts=(
417 $_hg_gitlike_opts
417 $_hg_gitlike_opts
418 '(--text -a)'{-a,--text}'[treat all files as text]'
418 '(--text -a)'{-a,--text}'[treat all files as text]'
419 '--nodates[omit dates from diff headers]')
419 '--nodates[omit dates from diff headers]')
420
420
421 _hg_mergetool_opts=(
421 _hg_mergetool_opts=(
422 '(--tool -t)'{-t+,--tool}'[specify merge tool]:tool:')
422 '(--tool -t)'{-t+,--tool}'[specify merge tool]:tool:')
423
423
424 _hg_dryrun_opts=(
424 _hg_dryrun_opts=(
425 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
425 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
426
426
427 _hg_ignore_space_opts=(
427 _hg_ignore_space_opts=(
428 '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]'
428 '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]'
429 '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]'
429 '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]'
430 '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]')
430 '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]')
431
431
432 _hg_style_opts=(
432 _hg_style_opts=(
433 '--style[display using template map file]:'
433 '--style[display using template map file]:'
434 '--template[display with template]:')
434 '--template[display with template]:')
435
435
436 _hg_log_opts=(
436 _hg_log_opts=(
437 $_hg_global_opts $_hg_style_opts $_hg_gitlike_opts
437 $_hg_global_opts $_hg_style_opts $_hg_gitlike_opts
438 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:'
438 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:'
439 '(--no-merges -M)'{-M,--no-merges}'[do not show merges]'
439 '(--no-merges -M)'{-M,--no-merges}'[do not show merges]'
440 '(--patch -p)'{-p,--patch}'[show patch]'
440 '(--patch -p)'{-p,--patch}'[show patch]'
441 '--stat[output diffstat-style summary of changes]'
441 '--stat[output diffstat-style summary of changes]'
442 )
442 )
443
443
444 _hg_commit_opts=(
444 _hg_commit_opts=(
445 '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
445 '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
446 '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
446 '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
447 '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
447 '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
448
448
449 _hg_remote_opts=(
449 _hg_remote_opts=(
450 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
450 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
451 '--remotecmd[specify hg command to run on the remote side]:')
451 '--remotecmd[specify hg command to run on the remote side]:')
452
452
453 _hg_branch_bmark_opts=(
453 _hg_branch_bmark_opts=(
454 '(--bookmark -B)'{-B+,--bookmark}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
454 '(--bookmark -B)'{-B+,--bookmark}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
455 '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches'
455 '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches'
456 )
456 )
457
457
458 _hg_subrepos_opts=(
458 _hg_subrepos_opts=(
459 '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]')
459 '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]')
460
460
461 _hg_cmd() {
461 _hg_cmd() {
462 _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null
462 _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null
463 }
463 }
464
464
465 _hg_cmd_add() {
465 _hg_cmd_add() {
466 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \
466 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \
467 '*:unknown files:_hg_unknown'
467 '*:unknown files:_hg_unknown'
468 }
468 }
469
469
470 _hg_cmd_addremove() {
470 _hg_cmd_addremove() {
471 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
471 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
472 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
472 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
473 '*:unknown or missing files:_hg_addremove'
473 '*:unknown or missing files:_hg_addremove'
474 }
474 }
475
475
476 _hg_cmd_annotate() {
476 _hg_cmd_annotate() {
477 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
477 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
478 '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_labels' \
478 '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_labels' \
479 '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \
479 '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \
480 '(--text -a)'{-a,--text}'[treat all files as text]' \
480 '(--text -a)'{-a,--text}'[treat all files as text]' \
481 '(--user -u)'{-u,--user}'[list the author]' \
481 '(--user -u)'{-u,--user}'[list the author]' \
482 '(--date -d)'{-d,--date}'[list the date]' \
482 '(--date -d)'{-d,--date}'[list the date]' \
483 '(--number -n)'{-n,--number}'[list the revision number (default)]' \
483 '(--number -n)'{-n,--number}'[list the revision number (default)]' \
484 '(--changeset -c)'{-c,--changeset}'[list the changeset]' \
484 '(--changeset -c)'{-c,--changeset}'[list the changeset]' \
485 '*:files:_hg_files'
485 '*:files:_hg_files'
486 }
486 }
487
487
488 _hg_cmd_archive() {
488 _hg_cmd_archive() {
489 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
489 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
490 '--no-decode[do not pass files through decoders]' \
490 '--no-decode[do not pass files through decoders]' \
491 '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \
491 '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \
492 '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \
492 '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \
493 '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
493 '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
494 '*:destination:_files'
494 '*:destination:_files'
495 }
495 }
496
496
497 _hg_cmd_backout() {
497 _hg_cmd_backout() {
498 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
498 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
499 '--merge[merge with old dirstate parent after backout]' \
499 '--merge[merge with old dirstate parent after backout]' \
500 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
500 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
501 '--parent[parent to choose when backing out merge]' \
501 '--parent[parent to choose when backing out merge]' \
502 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
502 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
503 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
503 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
504 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
504 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
505 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt'
505 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt'
506 }
506 }
507
507
508 _hg_cmd_bisect() {
508 _hg_cmd_bisect() {
509 _arguments -s -w : $_hg_global_opts \
509 _arguments -s -w : $_hg_global_opts \
510 '(-)'{-r,--reset}'[reset bisect state]' \
510 '(-)'{-r,--reset}'[reset bisect state]' \
511 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \
511 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \
512 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \
512 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \
513 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \
513 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \
514 '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \
514 '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \
515 '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]'
515 '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]'
516 }
516 }
517
517
518 _hg_cmd_bookmarks() {
518 _hg_cmd_bookmarks() {
519 _arguments -s -w : $_hg_global_opts \
519 _arguments -s -w : $_hg_global_opts \
520 '(--force -f)'{-f,--force}'[force]' \
520 '(--force -f)'{-f,--force}'[force]' \
521 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \
521 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \
522 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
522 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
523 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
523 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
524 ':bookmark:_hg_bookmarks'
524 ':bookmark:_hg_bookmarks'
525 }
525 }
526
526
527 _hg_cmd_branch() {
527 _hg_cmd_branch() {
528 _arguments -s -w : $_hg_global_opts \
528 _arguments -s -w : $_hg_global_opts \
529 '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \
529 '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \
530 '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]'
530 '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]'
531 }
531 }
532
532
533 _hg_cmd_branches() {
533 _hg_cmd_branches() {
534 _arguments -s -w : $_hg_global_opts \
534 _arguments -s -w : $_hg_global_opts \
535 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]'
535 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]'
536 }
536 }
537
537
538 _hg_cmd_bundle() {
538 _hg_cmd_bundle() {
539 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
539 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
540 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
540 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
541 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \
541 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \
542 ':output file:_files' \
542 ':output file:_files' \
543 ':destination repository:_files -/'
543 ':destination repository:_files -/'
544 }
544 }
545
545
546 _hg_cmd_cat() {
546 _hg_cmd_cat() {
547 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
547 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
548 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
548 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
549 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
549 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
550 '*:file:_hg_files'
550 '*:file:_hg_files'
551 }
551 }
552
552
553 _hg_cmd_clone() {
553 _hg_cmd_clone() {
554 _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
554 _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
555 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
555 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
556 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
556 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
557 '--uncompressed[use uncompressed transfer (fast over LAN)]' \
557 '--uncompressed[use uncompressed transfer (fast over LAN)]' \
558 ':source repository:_hg_remote' \
558 ':source repository:_hg_remote' \
559 ':destination:_hg_clone_dest'
559 ':destination:_hg_clone_dest'
560 }
560 }
561
561
562 _hg_cmd_commit() {
562 _hg_cmd_commit() {
563 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
563 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
564 '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
564 '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
565 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
565 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
566 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \
566 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \
567 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
567 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
568 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
568 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
569 '--amend[amend the parent of the working dir]' \
569 '--amend[amend the parent of the working dir]' \
570 '*:file:_hg_files'
570 '*:file:_hg_files'
571 }
571 }
572
572
573 _hg_cmd_copy() {
573 _hg_cmd_copy() {
574 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
574 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
575 '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \
575 '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \
576 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
576 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
577 '*:file:_hg_files'
577 '*:file:_hg_files'
578 }
578 }
579
579
580 _hg_cmd_diff() {
580 _hg_cmd_diff() {
581 typeset -A opt_args
581 typeset -A opt_args
582 _arguments -s -w : $_hg_global_opts $_hg_diff_opts $_hg_ignore_space_opts \
582 _arguments -s -w : $_hg_global_opts $_hg_diff_opts $_hg_ignore_space_opts \
583 $_hg_pat_opts $_hg_subrepos_opts \
583 $_hg_pat_opts $_hg_subrepos_opts \
584 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
584 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
585 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
585 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
586 '*:file:->diff_files'
586 '*:file:->diff_files'
587
587
588 if [[ $state == 'diff_files' ]]
588 if [[ $state == 'diff_files' ]]
589 then
589 then
590 if [[ -n $opt_args[-r] ]]
590 if [[ -n $opt_args[-r] ]]
591 then
591 then
592 _hg_files
592 _hg_files
593 else
593 else
594 _hg_modified
594 _hg_modified
595 fi
595 fi
596 fi
596 fi
597 }
597 }
598
598
599 _hg_cmd_export() {
599 _hg_cmd_export() {
600 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
600 _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
601 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
601 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
602 '--switch-parent[diff against the second parent]' \
602 '--switch-parent[diff against the second parent]' \
603 '*:revision:_hg_labels'
603 '*:revision:_hg_labels'
604 }
604 }
605
605
606 _hg_cmd_forget() {
606 _hg_cmd_forget() {
607 _arguments -s -w : $_hg_global_opts \
607 _arguments -s -w : $_hg_global_opts \
608 '*:file:_hg_files'
608 '*:file:_hg_files'
609 }
609 }
610
610
611 _hg_cmd_graft() {
611 _hg_cmd_graft() {
612 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \
612 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \
613 $_hg_date_user_opts $_hg_mergetool_opts \
613 $_hg_date_user_opts $_hg_mergetool_opts \
614 '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \
614 '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \
615 '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
615 '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
616 '--log[append graft info to log message]' \
616 '--log[append graft info to log message]' \
617 '*:revision:_hg_labels'
617 '*:revision:_hg_labels'
618 }
618 }
619
619
620 _hg_cmd_grep() {
620 _hg_cmd_grep() {
621 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
621 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
622 '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \
622 '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \
623 '--all[print all revisions with matches]' \
623 '--all[print all revisions with matches]' \
624 '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \
624 '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \
625 '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
625 '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
626 '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
626 '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
627 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
627 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
628 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
628 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
629 '(--user -u)'{-u,--user}'[print user who committed change]' \
629 '(--user -u)'{-u,--user}'[print user who committed change]' \
630 '1:search pattern:' \
630 '1:search pattern:' \
631 '*:files:_hg_files'
631 '*:files:_hg_files'
632 }
632 }
633
633
634 _hg_cmd_heads() {
634 _hg_cmd_heads() {
635 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
635 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
636 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels'
636 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels'
637 }
637 }
638
638
639 _hg_cmd_help() {
639 _hg_cmd_help() {
640 _arguments -s -w : $_hg_global_opts \
640 _arguments -s -w : $_hg_global_opts \
641 '*:mercurial help topic:_hg_help_topics'
641 '*:mercurial help topic:_hg_help_topics'
642 }
642 }
643
643
644 _hg_cmd_identify() {
644 _hg_cmd_identify() {
645 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
645 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
646 '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \
646 '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \
647 '(--num -n)'{-n+,--num}'[show local revision number]' \
647 '(--num -n)'{-n+,--num}'[show local revision number]' \
648 '(--id -i)'{-i+,--id}'[show global revision id]' \
648 '(--id -i)'{-i+,--id}'[show global revision id]' \
649 '(--branch -b)'{-b+,--branch}'[show branch]' \
649 '(--branch -b)'{-b+,--branch}'[show branch]' \
650 '(--tags -t)'{-t+,--tags}'[show tags]'
650 '(--tags -t)'{-t+,--tags}'[show tags]'
651 }
651 }
652
652
653 _hg_cmd_import() {
653 _hg_cmd_import() {
654 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
654 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
655 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
655 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
656 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
656 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
657 '--bypass[apply patch without touching the working directory]' \
657 '--bypass[apply patch without touching the working directory]' \
658 '*:patch:_files'
658 '*:patch:_files'
659 }
659 }
660
660
661 _hg_cmd_incoming() {
661 _hg_cmd_incoming() {
662 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
662 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
663 $_hg_subrepos_opts \
663 $_hg_subrepos_opts \
664 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
664 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
665 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
665 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
666 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
666 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
667 '--bundle[file to store the bundles into]:bundle file:_files' \
667 '--bundle[file to store the bundles into]:bundle file:_files' \
668 ':source:_hg_remote'
668 ':source:_hg_remote'
669 }
669 }
670
670
671 _hg_cmd_init() {
671 _hg_cmd_init() {
672 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
672 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
673 ':dir:_files -/'
673 ':dir:_files -/'
674 }
674 }
675
675
676 _hg_cmd_locate() {
676 _hg_cmd_locate() {
677 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
677 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
678 '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_labels' \
678 '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_labels' \
679 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
679 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
680 '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
680 '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
681 '*:search pattern:_hg_files'
681 '*:search pattern:_hg_files'
682 }
682 }
683
683
684 _hg_cmd_log() {
684 _hg_cmd_log() {
685 _arguments -s -w : $_hg_log_opts $_hg_pat_opts \
685 _arguments -s -w : $_hg_log_opts $_hg_pat_opts \
686 '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \
686 '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \
687 '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
687 '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
688 '(--copies -C)'{-C,--copies}'[show copied files]' \
688 '(--copies -C)'{-C,--copies}'[show copied files]' \
689 '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
689 '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
690 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
690 '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
691 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
691 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
692 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
692 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
693 '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
693 '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
694 '*:files:_hg_files'
694 '*:files:_hg_files'
695 }
695 }
696
696
697 _hg_cmd_manifest() {
697 _hg_cmd_manifest() {
698 _arguments -s -w : $_hg_global_opts \
698 _arguments -s -w : $_hg_global_opts \
699 '--all[list files from all revisions]' \
699 '--all[list files from all revisions]' \
700 ':revision:_hg_labels'
700 ':revision:_hg_labels'
701 }
701 }
702
702
703 _hg_cmd_merge() {
703 _hg_cmd_merge() {
704 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts \
704 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts \
705 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
705 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
706 '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
706 '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
707 '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
707 '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
708 ':revision:_hg_mergerevs'
708 ':revision:_hg_mergerevs'
709 }
709 }
710
710
711 _hg_cmd_outgoing() {
711 _hg_cmd_outgoing() {
712 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
712 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
713 $_hg_subrepos_opts \
713 $_hg_subrepos_opts \
714 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
714 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
715 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
715 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
716 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
716 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
717 ':destination:_hg_remote'
717 ':destination:_hg_remote'
718 }
718 }
719
719
720 _hg_cmd_parents() {
720 _hg_cmd_parents() {
721 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
721 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
722 '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_labels' \
722 '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_labels' \
723 ':last modified file:_hg_files'
723 ':last modified file:_hg_files'
724 }
724 }
725
725
726 _hg_cmd_paths() {
726 _hg_cmd_paths() {
727 _arguments -s -w : $_hg_global_opts \
727 _arguments -s -w : $_hg_global_opts \
728 ':path:_hg_paths'
728 ':path:_hg_paths'
729 }
729 }
730
730
731 _hg_cmd_phase() {
731 _hg_cmd_phase() {
732 _arguments -s -w : $_hg_global_opts \
732 _arguments -s -w : $_hg_global_opts \
733 '(--public -p)'{-p,--public}'[set changeset phase to public]' \
733 '(--public -p)'{-p,--public}'[set changeset phase to public]' \
734 '(--draft -d)'{-d,--draft}'[set changeset phase to draft]' \
734 '(--draft -d)'{-d,--draft}'[set changeset phase to draft]' \
735 '(--secret -s)'{-s,--secret}'[set changeset phase to secret]' \
735 '(--secret -s)'{-s,--secret}'[set changeset phase to secret]' \
736 '(--force -f)'{-f,--force}'[allow to move boundary backward]' \
736 '(--force -f)'{-f,--force}'[allow to move boundary backward]' \
737 '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
737 '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
738 ':revision:_hg_labels'
738 ':revision:_hg_labels'
739 }
739 }
740
740
741 _hg_cmd_pull() {
741 _hg_cmd_pull() {
742 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
742 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
743 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
743 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
744 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
744 '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
745 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
745 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
746 ':source:_hg_remote'
746 ':source:_hg_remote'
747 }
747 }
748
748
749 _hg_cmd_push() {
749 _hg_cmd_push() {
750 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
750 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
751 '(--force -f)'{-f,--force}'[force push]' \
751 '(--force -f)'{-f,--force}'[force push]' \
752 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
752 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
753 ':destination:_hg_remote'
753 ':destination:_hg_remote'
754 }
754 }
755
755
756 _hg_cmd_remove() {
756 _hg_cmd_remove() {
757 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
757 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
758 '(--after -A)'{-A,--after}'[record remove that has already occurred]' \
758 '(--after -A)'{-A,--after}'[record remove that has already occurred]' \
759 '(--force -f)'{-f,--force}'[remove file even if modified]' \
759 '(--force -f)'{-f,--force}'[remove file even if modified]' \
760 '*:file:_hg_files'
760 '*:file:_hg_files'
761 }
761 }
762
762
763 _hg_cmd_rename() {
763 _hg_cmd_rename() {
764 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
764 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
765 '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \
765 '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \
766 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
766 '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \
767 '*:file:_hg_files'
767 '*:file:_hg_files'
768 }
768 }
769
769
770 _hg_cmd_resolve() {
770 _hg_cmd_resolve() {
771 local context state line
771 local context state line
772 typeset -A opt_args
772 typeset -A opt_args
773
773
774 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
774 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
775 '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
775 '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
776 '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
776 '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
777 '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
777 '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
778 '*:file:_hg_unresolved'
778 '*:file:_hg_unresolved'
779
779
780 if [[ $state == 'resolve_files' ]]
780 if [[ $state == 'resolve_files' ]]
781 then
781 then
782 _alternative 'files:resolved files:_hg_resolved' \
782 _alternative 'files:resolved files:_hg_resolved' \
783 'files:unresolved files:_hg_unresolved'
783 'files:unresolved files:_hg_unresolved'
784 fi
784 fi
785 }
785 }
786
786
787 _hg_cmd_revert() {
787 _hg_cmd_revert() {
788 local context state line
788 local context state line
789 typeset -A opt_args
789 typeset -A opt_args
790
790
791 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
791 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
792 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
792 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
793 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
793 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
794 '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
794 '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
795 '*:file:->diff_files'
795 '*:file:->diff_files'
796
796
797 if [[ $state == 'diff_files' ]]
797 if [[ $state == 'diff_files' ]]
798 then
798 then
799 if [[ -n $opt_args[-r] ]]
799 if [[ -n $opt_args[-r] ]]
800 then
800 then
801 _hg_files
801 _hg_files
802 else
802 else
803 typeset -a status_files
803 typeset -a status_files
804 _hg_status mard
804 _hg_status mard
805 _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files
805 _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files
806 fi
806 fi
807 fi
807 fi
808 }
808 }
809
809
810 _hg_cmd_rollback() {
810 _hg_cmd_rollback() {
811 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \
811 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \
812 '(--force -f)'{-f,--force}'[ignore safety measures]' \
812 '(--force -f)'{-f,--force}'[ignore safety measures]' \
813 }
813 }
814
814
815 _hg_cmd_serve() {
815 _hg_cmd_serve() {
816 _arguments -s -w : $_hg_global_opts \
816 _arguments -s -w : $_hg_global_opts \
817 '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \
817 '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \
818 '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \
818 '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \
819 '(--daemon -d)'{-d,--daemon}'[run server in background]' \
819 '(--daemon -d)'{-d,--daemon}'[run server in background]' \
820 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
820 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
821 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
821 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
822 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
822 '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
823 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
823 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
824 '--style[web template style]:style' \
824 '--style[web template style]:style' \
825 '--stdio[for remote clients]' \
825 '--stdio[for remote clients]' \
826 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
826 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
827 }
827 }
828
828
829 _hg_cmd_showconfig() {
829 _hg_cmd_showconfig() {
830 _arguments -s -w : $_hg_global_opts \
830 _arguments -s -w : $_hg_global_opts \
831 '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \
831 '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \
832 ':config item:_hg_config'
832 ':config item:_hg_config'
833 }
833 }
834
834
835 _hg_cmd_status() {
835 _hg_cmd_status() {
836 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
836 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
837 '(--all -A)'{-A,--all}'[show status of all files]' \
837 '(--all -A)'{-A,--all}'[show status of all files]' \
838 '(--modified -m)'{-m,--modified}'[show only modified files]' \
838 '(--modified -m)'{-m,--modified}'[show only modified files]' \
839 '(--added -a)'{-a,--added}'[show only added files]' \
839 '(--added -a)'{-a,--added}'[show only added files]' \
840 '(--removed -r)'{-r,--removed}'[show only removed files]' \
840 '(--removed -r)'{-r,--removed}'[show only removed files]' \
841 '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \
841 '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \
842 '(--clean -c)'{-c,--clean}'[show only files without changes]' \
842 '(--clean -c)'{-c,--clean}'[show only files without changes]' \
843 '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \
843 '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \
844 '(--ignored -i)'{-i,--ignored}'[show ignored files]' \
844 '(--ignored -i)'{-i,--ignored}'[show ignored files]' \
845 '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \
845 '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \
846 '(--copies -C)'{-C,--copies}'[show source of copied files]' \
846 '(--copies -C)'{-C,--copies}'[show source of copied files]' \
847 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
847 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
848 '--rev[show difference from revision]:revision:_hg_labels' \
848 '--rev[show difference from revision]:revision:_hg_labels' \
849 '*:files:_files'
849 '*:files:_files'
850 }
850 }
851
851
852 _hg_cmd_summary() {
852 _hg_cmd_summary() {
853 _arguments -s -w : $_hg_global_opts \
853 _arguments -s -w : $_hg_global_opts \
854 '--remote[check for push and pull]'
854 '--remote[check for push and pull]'
855 }
855 }
856
856
857 _hg_cmd_tag() {
857 _hg_cmd_tag() {
858 _arguments -s -w : $_hg_global_opts \
858 _arguments -s -w : $_hg_global_opts \
859 '(--local -l)'{-l,--local}'[make the tag local]' \
859 '(--local -l)'{-l,--local}'[make the tag local]' \
860 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \
860 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \
861 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
861 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
862 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
862 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
863 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
863 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
864 ':tag name:'
864 ':tag name:'
865 }
865 }
866
866
867 _hg_cmd_tip() {
867 _hg_cmd_tip() {
868 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts $_hg_style_opts \
868 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts $_hg_style_opts \
869 '(--patch -p)'{-p,--patch}'[show patch]'
869 '(--patch -p)'{-p,--patch}'[show patch]'
870 }
870 }
871
871
872 _hg_cmd_unbundle() {
872 _hg_cmd_unbundle() {
873 _arguments -s -w : $_hg_global_opts \
873 _arguments -s -w : $_hg_global_opts \
874 '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \
874 '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \
875 ':files:_files'
875 ':files:_files'
876 }
876 }
877
877
878 _hg_cmd_update() {
878 _hg_cmd_update() {
879 _arguments -s -w : $_hg_global_opts \
879 _arguments -s -w : $_hg_global_opts \
880 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
880 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
881 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
881 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
882 ':revision:_hg_labels'
882 ':revision:_hg_labels'
883 }
883 }
884
884
885 ## extensions ##
885 ## extensions ##
886
886
887 # HGK
887 # HGK
888 _hg_cmd_view() {
888 _hg_cmd_view() {
889 _arguments -s -w : $_hg_global_opts \
889 _arguments -s -w : $_hg_global_opts \
890 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
890 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
891 ':revision range:_hg_tags'
891 ':revision range:_hg_tags'
892 }
892 }
893
893
894 # MQ
894 # MQ
895 _hg_qseries() {
895 _hg_qseries() {
896 typeset -a patches
896 typeset -a patches
897 patches=(${(f)"$(_hg_cmd qseries)"})
897 patches=(${(f)"$(_hg_cmd qseries)"})
898 (( $#patches )) && _describe -t hg-patches 'patches' patches
898 (( $#patches )) && _describe -t hg-patches 'patches' patches
899 }
899 }
900
900
901 _hg_qapplied() {
901 _hg_qapplied() {
902 typeset -a patches
902 typeset -a patches
903 patches=(${(f)"$(_hg_cmd qapplied)"})
903 patches=(${(f)"$(_hg_cmd qapplied)"})
904 if (( $#patches ))
904 if (( $#patches ))
905 then
905 then
906 patches+=(qbase qtip)
906 patches+=(qbase qtip)
907 _describe -t hg-applied-patches 'applied patches' patches
907 _describe -t hg-applied-patches 'applied patches' patches
908 fi
908 fi
909 }
909 }
910
910
911 _hg_qunapplied() {
911 _hg_qunapplied() {
912 typeset -a patches
912 typeset -a patches
913 patches=(${(f)"$(_hg_cmd qunapplied)"})
913 patches=(${(f)"$(_hg_cmd qunapplied)"})
914 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches
914 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches
915 }
915 }
916
916
917 # unapplied, including guarded patches
917 # unapplied, including guarded patches
918 _hg_qdeletable() {
918 _hg_qdeletable() {
919 typeset -a unapplied
919 typeset -a unapplied
920 unapplied=(${(f)"$(_hg_cmd qseries)"})
920 unapplied=(${(f)"$(_hg_cmd qseries)"})
921 for p in $(_hg_cmd qapplied)
921 for p in $(_hg_cmd qapplied)
922 do
922 do
923 unapplied=(${unapplied:#$p})
923 unapplied=(${unapplied:#$p})
924 done
924 done
925
925
926 (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied
926 (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied
927 }
927 }
928
928
929 _hg_qguards() {
929 _hg_qguards() {
930 typeset -a guards
930 typeset -a guards
931 local guard
931 local guard
932 compset -P "+|-"
932 compset -P "+|-"
933 _hg_cmd qselect -s | while read guard
933 _hg_cmd qselect -s | while read guard
934 do
934 do
935 guards+=(${guard#(+|-)})
935 guards+=(${guard#(+|-)})
936 done
936 done
937 (( $#guards )) && _describe -t hg-guards 'guards' guards
937 (( $#guards )) && _describe -t hg-guards 'guards' guards
938 }
938 }
939
939
940 _hg_qseries_opts=(
940 _hg_qseries_opts=(
941 '(--summary -s)'{-s,--summary}'[print first line of patch header]')
941 '(--summary -s)'{-s,--summary}'[print first line of patch header]')
942
942
943 _hg_cmd_qapplied() {
943 _hg_cmd_qapplied() {
944 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
944 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
945 }
945 }
946
946
947 _hg_cmd_qdelete() {
947 _hg_cmd_qdelete() {
948 _arguments -s -w : $_hg_global_opts \
948 _arguments -s -w : $_hg_global_opts \
949 '(--keep -k)'{-k,--keep}'[keep patch file]' \
949 '(--keep -k)'{-k,--keep}'[keep patch file]' \
950 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
950 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
951 '*:unapplied patch:_hg_qdeletable'
951 '*:unapplied patch:_hg_qdeletable'
952 }
952 }
953
953
954 _hg_cmd_qdiff() {
954 _hg_cmd_qdiff() {
955 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
955 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
956 $_hg_ignore_space_opts \
956 $_hg_ignore_space_opts \
957 '*:pattern:_hg_files'
957 '*:pattern:_hg_files'
958 }
958 }
959
959
960 _hg_cmd_qfinish() {
960 _hg_cmd_qfinish() {
961 _arguments -s -w : $_hg_global_opts \
961 _arguments -s -w : $_hg_global_opts \
962 '(--applied -a)'{-a,--applied}'[finish all applied patches]' \
962 '(--applied -a)'{-a,--applied}'[finish all applied patches]' \
963 '*:patch:_hg_qapplied'
963 '*:patch:_hg_qapplied'
964 }
964 }
965
965
966 _hg_cmd_qfold() {
966 _hg_cmd_qfold() {
967 _arguments -s -w : $_hg_global_opts $_h_commit_opts \
967 _arguments -s -w : $_hg_global_opts $_h_commit_opts \
968 '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \
968 '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \
969 '*:unapplied patch:_hg_qunapplied'
969 '*:unapplied patch:_hg_qunapplied'
970 }
970 }
971
971
972 _hg_cmd_qgoto() {
972 _hg_cmd_qgoto() {
973 _arguments -s -w : $_hg_global_opts \
973 _arguments -s -w : $_hg_global_opts \
974 '(--force -f)'{-f,--force}'[overwrite any local changes]' \
974 '(--force -f)'{-f,--force}'[overwrite any local changes]' \
975 ':patch:_hg_qseries'
975 ':patch:_hg_qseries'
976 }
976 }
977
977
978 _hg_cmd_qguard() {
978 _hg_cmd_qguard() {
979 _arguments -s -w : $_hg_global_opts \
979 _arguments -s -w : $_hg_global_opts \
980 '(--list -l)'{-l,--list}'[list all patches and guards]' \
980 '(--list -l)'{-l,--list}'[list all patches and guards]' \
981 '(--none -n)'{-n,--none}'[drop all guards]' \
981 '(--none -n)'{-n,--none}'[drop all guards]' \
982 ':patch:_hg_qseries' \
982 ':patch:_hg_qseries' \
983 '*:guards:_hg_qguards'
983 '*:guards:_hg_qguards'
984 }
984 }
985
985
986 _hg_cmd_qheader() {
986 _hg_cmd_qheader() {
987 _arguments -s -w : $_hg_global_opts \
987 _arguments -s -w : $_hg_global_opts \
988 ':patch:_hg_qseries'
988 ':patch:_hg_qseries'
989 }
989 }
990
990
991 _hg_cmd_qimport() {
991 _hg_cmd_qimport() {
992 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts \
992 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts \
993 '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
993 '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
994 '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
994 '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
995 '(--force -f)'{-f,--force}'[overwrite existing files]' \
995 '(--force -f)'{-f,--force}'[overwrite existing files]' \
996 '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
996 '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
997 '*:patch:_files'
997 '*:patch:_files'
998 }
998 }
999
999
1000 _hg_cmd_qnew() {
1000 _hg_cmd_qnew() {
1001 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
1001 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
1002 $_hg_date_user_opts $_hg_gitlike_opts \
1002 $_hg_date_user_opts $_hg_gitlike_opts \
1003 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \
1003 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \
1004 ':patch:'
1004 ':patch:'
1005 }
1005 }
1006
1006
1007 _hg_cmd_qnext() {
1007 _hg_cmd_qnext() {
1008 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1008 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1009 }
1009 }
1010
1010
1011 _hg_cmd_qpop() {
1011 _hg_cmd_qpop() {
1012 _arguments -s -w : $_hg_global_opts \
1012 _arguments -s -w : $_hg_global_opts \
1013 '(--all -a :)'{-a,--all}'[pop all patches]' \
1013 '(--all -a :)'{-a,--all}'[pop all patches]' \
1014 '(--name -n)'{-n+,--name}'[queue name to pop]:' \
1014 '(--name -n)'{-n+,--name}'[queue name to pop]:' \
1015 '(--force -f)'{-f,--force}'[forget any local changes]' \
1015 '(--force -f)'{-f,--force}'[forget any local changes]' \
1016 ':patch:_hg_qapplied'
1016 ':patch:_hg_qapplied'
1017 }
1017 }
1018
1018
1019 _hg_cmd_qprev() {
1019 _hg_cmd_qprev() {
1020 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1020 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1021 }
1021 }
1022
1022
1023 _hg_cmd_qpush() {
1023 _hg_cmd_qpush() {
1024 _arguments -s -w : $_hg_global_opts \
1024 _arguments -s -w : $_hg_global_opts \
1025 '(--all -a :)'{-a,--all}'[apply all patches]' \
1025 '(--all -a :)'{-a,--all}'[apply all patches]' \
1026 '(--list -l)'{-l,--list}'[list patch name in commit text]' \
1026 '(--list -l)'{-l,--list}'[list patch name in commit text]' \
1027 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
1027 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
1028 '(--name -n)'{-n+,--name}'[merge queue name]:' \
1028 '(--name -n)'{-n+,--name}'[merge queue name]:' \
1029 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
1029 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
1030 '(--exact -e)'{-e,--exact}'[apply the target patch to its recorded parent]' \
1030 '(--exact -e)'{-e,--exact}'[apply the target patch to its recorded parent]' \
1031 '--move[reorder patch series and apply only the patch]' \
1031 '--move[reorder patch series and apply only the patch]' \
1032 ':patch:_hg_qunapplied'
1032 ':patch:_hg_qunapplied'
1033 }
1033 }
1034
1034
1035 _hg_cmd_qrefresh() {
1035 _hg_cmd_qrefresh() {
1036 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts $_hg_gitlike_opts \
1036 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts $_hg_gitlike_opts \
1037 '(--git -g)'{-g,--git}'[use git extended diff format]' \
1037 '(--git -g)'{-g,--git}'[use git extended diff format]' \
1038 '(--short -s)'{-s,--short}'[short refresh]' \
1038 '(--short -s)'{-s,--short}'[short refresh]' \
1039 '*:files:_hg_files'
1039 '*:files:_hg_files'
1040 }
1040 }
1041
1041
1042 _hg_cmd_qrename() {
1042 _hg_cmd_qrename() {
1043 _arguments -s -w : $_hg_global_opts \
1043 _arguments -s -w : $_hg_global_opts \
1044 ':patch:_hg_qseries' \
1044 ':patch:_hg_qseries' \
1045 ':destination:'
1045 ':destination:'
1046 }
1046 }
1047
1047
1048 _hg_cmd_qselect() {
1048 _hg_cmd_qselect() {
1049 _arguments -s -w : $_hg_global_opts \
1049 _arguments -s -w : $_hg_global_opts \
1050 '(--none -n :)'{-n,--none}'[disable all guards]' \
1050 '(--none -n :)'{-n,--none}'[disable all guards]' \
1051 '(--series -s :)'{-s,--series}'[list all guards in series file]' \
1051 '(--series -s :)'{-s,--series}'[list all guards in series file]' \
1052 '--pop[pop to before first guarded applied patch]' \
1052 '--pop[pop to before first guarded applied patch]' \
1053 '--reapply[pop and reapply patches]' \
1053 '--reapply[pop and reapply patches]' \
1054 '*:guards:_hg_qguards'
1054 '*:guards:_hg_qguards'
1055 }
1055 }
1056
1056
1057 _hg_cmd_qseries() {
1057 _hg_cmd_qseries() {
1058 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \
1058 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \
1059 '(--missing -m)'{-m,--missing}'[print patches not in series]'
1059 '(--missing -m)'{-m,--missing}'[print patches not in series]'
1060 }
1060 }
1061
1061
1062 _hg_cmd_qunapplied() {
1062 _hg_cmd_qunapplied() {
1063 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1063 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1064 }
1064 }
1065
1065
1066 _hg_cmd_qtop() {
1066 _hg_cmd_qtop() {
1067 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1067 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts
1068 }
1068 }
1069
1069
1070 _hg_cmd_strip() {
1070 _hg_cmd_strip() {
1071 _arguments -s -w : $_hg_global_opts \
1071 _arguments -s -w : $_hg_global_opts \
1072 '(--force -f)'{-f,--force}'[force multi-head removal]' \
1072 '(--force -f)'{-f,--force}'[force multi-head removal]' \
1073 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \
1073 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \
1074 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \
1074 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \
1075 ':revision:_hg_labels'
1075 ':revision:_hg_labels'
1076 }
1076 }
1077
1077
1078 # Patchbomb
1078 # Patchbomb
1079 _hg_cmd_email() {
1079 _hg_cmd_email() {
1080 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_gitlike_opts \
1080 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_gitlike_opts \
1081 '--plain[omit hg patch header]' \
1081 '--plain[omit hg patch header]' \
1082 '--body[send patches as inline message text (default)]' \
1082 '--body[send patches as inline message text (default)]' \
1083 '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
1083 '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
1084 '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
1084 '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
1085 '--bundlename[name of the bundle attachment file (default: bundle)]:' \
1085 '--bundlename[name of the bundle attachment file (default: bundle)]:' \
1086 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
1086 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
1087 '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
1087 '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
1088 '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_labels' \
1088 '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_labels' \
1089 '--intro[send an introduction email for a single patch]' \
1089 '--intro[send an introduction email for a single patch]' \
1090 '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \
1090 '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \
1091 '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \
1091 '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \
1092 '*--bcc[email addresses of blind carbon copy recipients]:email:' \
1092 '*--bcc[email addresses of blind carbon copy recipients]:email:' \
1093 '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \
1093 '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \
1094 '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \
1094 '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \
1095 '--date[use the given date as the sending date]:date:' \
1095 '--date[use the given date as the sending date]:date:' \
1096 '--desc[use the given file as the series description]:files:_files' \
1096 '--desc[use the given file as the series description]:files:_files' \
1097 '(--from -f)'{-f,--from}'[email address of sender]:email:' \
1097 '(--from -f)'{-f,--from}'[email address of sender]:email:' \
1098 '(--test -n)'{-n,--test}'[print messages that would be sent]' \
1098 '(--test -n)'{-n,--test}'[print messages that would be sent]' \
1099 '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \
1099 '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \
1100 '*--reply-to[email addresses replies should be sent to]:email:' \
1100 '*--reply-to[email addresses replies should be sent to]:email:' \
1101 '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \
1101 '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \
1102 '--in-reply-to[message identifier to reply to]:msgid:' \
1102 '--in-reply-to[message identifier to reply to]:msgid:' \
1103 '*--flag[flags to add in subject prefixes]:flag:' \
1103 '*--flag[flags to add in subject prefixes]:flag:' \
1104 '*'{-t,--to}'[email addresses of recipients]:email:' \
1104 '*'{-t,--to}'[email addresses of recipients]:email:' \
1105 ':revision:_hg_revrange'
1105 ':revision:_hg_revrange'
1106 }
1106 }
1107
1107
1108 # Rebase
1108 # Rebase
1109 _hg_cmd_rebase() {
1109 _hg_cmd_rebase() {
1110 _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_mergetool_opts \
1110 _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_mergetool_opts \
1111 '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
1111 '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
1112 '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
1112 '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
1113 '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
1113 '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
1114 '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \
1114 '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \
1115 '--collapse[collapse the rebased changeset]' \
1115 '--collapse[collapse the rebased changeset]' \
1116 '--keep[keep original changeset]' \
1116 '--keep[keep original changeset]' \
1117 '--keepbranches[keep original branch name]' \
1117 '--keepbranches[keep original branch name]' \
1118 '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \
1118 '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \
1119 '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \
1119 '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \
1120 }
1120 }
1121
1121
1122 # Record
1123 _hg_cmd_record() {
1124 _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_pat_opts \
1125 $_hg_ignore_space_opts $_hg_subrepos_opts \
1126 '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
1127 '--close-branch[mark a branch as closed, hiding it from the branch list]' \
1128 '--amend[amend the parent of the working dir]' \
1129 '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:' \
1130 '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:'
1131 }
1132
1133 _hg_cmd_qrecord() {
1134 _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_date_user_opts $_hg_gitlike_opts \
1135 $_hg_pat_opts $_hg_ignore_space_opts $_hg_subrepos_opts
1136 }
1137
1138 # Convert
1139 _hg_cmd_convert() {
1140 _arguments -s -w : $_hg_global_opts \
1141 '(--source-type -s)'{-s,--source-type}'[source repository type]' \
1142 '(--dest-type -d)'{-d,--dest-type}'[destination repository type]' \
1143 '(--rev -r)'{-r+,--rev}'[import up to target revision]:revision:' \
1144 '(--authormap -A)'{-A+,--authormap}'[remap usernames using this file]:file:_files' \
1145 '--filemap[remap file names using contents of file]:file:_files' \
1146 '--splicemap[splice synthesized history into place]:file:_files' \
1147 '--branchmap[change branch names while converting]:file:_files' \
1148 '--branchsort[try to sort changesets by branches]' \
1149 '--datesort[try to sort changesets by date]' \
1150 '--sourcesort[preserve source changesets order]'
1151 }
1152
1153 # Graphlog
1154 _hg_cmd_glog() {
1155 _hg_cmd_log $@
1156 }
1157
1158 # Purge
1159 _hg_cmd_purge() {
1160 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
1161 '(--abort-on-err -a)'{-a,--abort-on-err}'[abort if an error occurs]' \
1162 '--all[purge ignored files too]' \
1163 '(--print -p)'{-p,--print}'[print filenames instead of deleting them]' \
1164 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs (implies -p/--print)]'
1165 }
1166
1122 _hg "$@"
1167 _hg "$@"
General Comments 0
You need to be logged in to leave comments. Login now