Show More
@@ -1,1006 +1,1010 | |||||
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 "$@" | |||
|
163 | } | |||
|
164 | ||||
|
165 | _hg_labels() { | |||
162 | _hg_tags "$@" |
|
166 | _hg_tags "$@" | |
|
167 | _hg_bookmarks "$@" | |||
163 | } |
|
168 | } | |
164 |
|
169 | |||
165 | _hg_tags() { |
|
170 | _hg_tags() { | |
166 | typeset -a tags |
|
171 | typeset -a tags | |
167 | local tag rev |
|
172 | local tag rev | |
168 |
|
173 | |||
169 | _hg_cmd tags | while read tag |
|
174 | _hg_cmd tags | while read tag | |
170 | do |
|
175 | do | |
171 | tags+=(${tag/ # [0-9]#:*}) |
|
176 | tags+=(${tag/ # [0-9]#:*}) | |
172 | done |
|
177 | done | |
173 | (( $#tags )) && _describe -t tags 'tags' tags |
|
178 | (( $#tags )) && _describe -t tags 'tags' tags | |
174 | } |
|
179 | } | |
175 |
|
180 | |||
|
181 | _hg_bookmarks() { | |||
|
182 | typeset -a bookmark bookmarks | |||
|
183 | ||||
|
184 | _hg_cmd bookmarks | while read -A bookmark | |||
|
185 | do | |||
|
186 | if test -z ${bookmark[-1]:#[0-9]*} | |||
|
187 | then | |||
|
188 | bookmarks+=($bookmark[-2]) | |||
|
189 | fi | |||
|
190 | done | |||
|
191 | (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks | |||
|
192 | } | |||
|
193 | ||||
176 | # likely merge candidates |
|
194 | # likely merge candidates | |
177 | _hg_mergerevs() { |
|
195 | _hg_mergerevs() { | |
178 | typeset -a heads |
|
196 | typeset -a heads | |
179 | local myrev |
|
197 | local myrev | |
180 |
|
198 | |||
181 | heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) |
|
199 | heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) | |
182 | # exclude own revision |
|
200 | # exclude own revision | |
183 | myrev=$(_hg_cmd log -r . --template '{rev}\\n') |
|
201 | myrev=$(_hg_cmd log -r . --template '{rev}\\n') | |
184 | heads=(${heads:#$myrev}) |
|
202 | heads=(${heads:#$myrev}) | |
185 |
|
203 | |||
186 | (( $#heads )) && _describe -t heads 'heads' heads |
|
204 | (( $#heads )) && _describe -t heads 'heads' heads | |
187 | } |
|
205 | } | |
188 |
|
206 | |||
189 | _hg_files() { |
|
207 | _hg_files() { | |
190 | if [[ -n "$_hg_root" ]] |
|
208 | if [[ -n "$_hg_root" ]] | |
191 | then |
|
209 | then | |
192 | [[ -d "$_hg_root/.hg" ]] || return |
|
210 | [[ -d "$_hg_root/.hg" ]] || return | |
193 | case "$_hg_root" in |
|
211 | case "$_hg_root" in | |
194 | /*) |
|
212 | /*) | |
195 | _files -W $_hg_root |
|
213 | _files -W $_hg_root | |
196 | ;; |
|
214 | ;; | |
197 | *) |
|
215 | *) | |
198 | _files -W $PWD/$_hg_root |
|
216 | _files -W $PWD/$_hg_root | |
199 | ;; |
|
217 | ;; | |
200 | esac |
|
218 | esac | |
201 | else |
|
219 | else | |
202 | _files |
|
220 | _files | |
203 | fi |
|
221 | fi | |
204 | } |
|
222 | } | |
205 |
|
223 | |||
206 | _hg_status() { |
|
224 | _hg_status() { | |
207 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
|
225 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | |
208 | status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) |
|
226 | status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) | |
209 | } |
|
227 | } | |
210 |
|
228 | |||
211 | _hg_unknown() { |
|
229 | _hg_unknown() { | |
212 | typeset -a status_files |
|
230 | typeset -a status_files | |
213 | _hg_status u |
|
231 | _hg_status u | |
214 | _wanted files expl 'unknown files' _multi_parts / status_files |
|
232 | _wanted files expl 'unknown files' _multi_parts / status_files | |
215 | } |
|
233 | } | |
216 |
|
234 | |||
217 | _hg_missing() { |
|
235 | _hg_missing() { | |
218 | typeset -a status_files |
|
236 | typeset -a status_files | |
219 | _hg_status d |
|
237 | _hg_status d | |
220 | _wanted files expl 'missing files' _multi_parts / status_files |
|
238 | _wanted files expl 'missing files' _multi_parts / status_files | |
221 | } |
|
239 | } | |
222 |
|
240 | |||
223 | _hg_modified() { |
|
241 | _hg_modified() { | |
224 | typeset -a status_files |
|
242 | typeset -a status_files | |
225 | _hg_status m |
|
243 | _hg_status m | |
226 | _wanted files expl 'modified files' _multi_parts / status_files |
|
244 | _wanted files expl 'modified files' _multi_parts / status_files | |
227 | } |
|
245 | } | |
228 |
|
246 | |||
229 | _hg_resolve() { |
|
247 | _hg_resolve() { | |
230 | local rstate rpath |
|
248 | local rstate rpath | |
231 |
|
249 | |||
232 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
|
250 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | |
233 |
|
251 | |||
234 | _hg_cmd resolve -l ./$PREFIX | while read rstate rpath |
|
252 | _hg_cmd resolve -l ./$PREFIX | while read rstate rpath | |
235 | do |
|
253 | do | |
236 | [[ $rstate == 'R' ]] && resolved_files+=($rpath) |
|
254 | [[ $rstate == 'R' ]] && resolved_files+=($rpath) | |
237 | [[ $rstate == 'U' ]] && unresolved_files+=($rpath) |
|
255 | [[ $rstate == 'U' ]] && unresolved_files+=($rpath) | |
238 | done |
|
256 | done | |
239 | } |
|
257 | } | |
240 |
|
258 | |||
241 | _hg_resolved() { |
|
259 | _hg_resolved() { | |
242 | typeset -a resolved_files unresolved_files |
|
260 | typeset -a resolved_files unresolved_files | |
243 | _hg_resolve |
|
261 | _hg_resolve | |
244 | _wanted files expl 'resolved files' _multi_parts / resolved_files |
|
262 | _wanted files expl 'resolved files' _multi_parts / resolved_files | |
245 | } |
|
263 | } | |
246 |
|
264 | |||
247 | _hg_unresolved() { |
|
265 | _hg_unresolved() { | |
248 | typeset -a resolved_files unresolved_files |
|
266 | typeset -a resolved_files unresolved_files | |
249 | _hg_resolve |
|
267 | _hg_resolve | |
250 | _wanted files expl 'unresolved files' _multi_parts / unresolved_files |
|
268 | _wanted files expl 'unresolved files' _multi_parts / unresolved_files | |
251 | } |
|
269 | } | |
252 |
|
270 | |||
253 | _hg_config() { |
|
271 | _hg_config() { | |
254 | typeset -a items |
|
272 | typeset -a items | |
255 | items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) |
|
273 | items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) | |
256 | (( $#items )) && _describe -t config 'config item' items |
|
274 | (( $#items )) && _describe -t config 'config item' items | |
257 | } |
|
275 | } | |
258 |
|
276 | |||
259 | _hg_addremove() { |
|
277 | _hg_addremove() { | |
260 | _alternative 'files:unknown files:_hg_unknown' \ |
|
278 | _alternative 'files:unknown files:_hg_unknown' \ | |
261 | 'files:missing files:_hg_missing' |
|
279 | 'files:missing files:_hg_missing' | |
262 | } |
|
280 | } | |
263 |
|
281 | |||
264 | _hg_ssh_urls() { |
|
282 | _hg_ssh_urls() { | |
265 | if [[ -prefix */ ]] |
|
283 | if [[ -prefix */ ]] | |
266 | then |
|
284 | then | |
267 | if zstyle -T ":completion:${curcontext}:files" remote-access |
|
285 | if zstyle -T ":completion:${curcontext}:files" remote-access | |
268 | then |
|
286 | then | |
269 | local host=${PREFIX%%/*} |
|
287 | local host=${PREFIX%%/*} | |
270 | typeset -a remdirs |
|
288 | typeset -a remdirs | |
271 | compset -p $(( $#host + 1 )) |
|
289 | compset -p $(( $#host + 1 )) | |
272 | local rempath=${(M)PREFIX##*/} |
|
290 | local rempath=${(M)PREFIX##*/} | |
273 | local cacheid="hg:${host}-${rempath//\//_}" |
|
291 | local cacheid="hg:${host}-${rempath//\//_}" | |
274 | cacheid=${cacheid%[-_]} |
|
292 | cacheid=${cacheid%[-_]} | |
275 | compset -P '*/' |
|
293 | compset -P '*/' | |
276 | if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" |
|
294 | if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" | |
277 | then |
|
295 | then | |
278 | remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) |
|
296 | remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) | |
279 | _store_cache "$cacheid" remdirs |
|
297 | _store_cache "$cacheid" remdirs | |
280 | fi |
|
298 | fi | |
281 | _describe -t directories 'remote directory' remdirs -S/ |
|
299 | _describe -t directories 'remote directory' remdirs -S/ | |
282 | else |
|
300 | else | |
283 | _message 'remote directory' |
|
301 | _message 'remote directory' | |
284 | fi |
|
302 | fi | |
285 | else |
|
303 | else | |
286 | if compset -P '*@' |
|
304 | if compset -P '*@' | |
287 | then |
|
305 | then | |
288 | _hosts -S/ |
|
306 | _hosts -S/ | |
289 | else |
|
307 | else | |
290 | _alternative 'hosts:remote host name:_hosts -S/' \ |
|
308 | _alternative 'hosts:remote host name:_hosts -S/' \ | |
291 | 'users:user:_users -S@' |
|
309 | 'users:user:_users -S@' | |
292 | fi |
|
310 | fi | |
293 | fi |
|
311 | fi | |
294 | } |
|
312 | } | |
295 |
|
313 | |||
296 | _hg_urls() { |
|
314 | _hg_urls() { | |
297 | if compset -P bundle:// |
|
315 | if compset -P bundle:// | |
298 | then |
|
316 | then | |
299 | _files |
|
317 | _files | |
300 | elif compset -P ssh:// |
|
318 | elif compset -P ssh:// | |
301 | then |
|
319 | then | |
302 | _hg_ssh_urls |
|
320 | _hg_ssh_urls | |
303 | elif [[ -prefix *: ]] |
|
321 | elif [[ -prefix *: ]] | |
304 | then |
|
322 | then | |
305 | _urls |
|
323 | _urls | |
306 | else |
|
324 | else | |
307 | local expl |
|
325 | local expl | |
308 | compset -S '[^:]*' |
|
326 | compset -S '[^:]*' | |
309 | _wanted url-schemas expl 'URL schema' compadd -S '' - \ |
|
327 | _wanted url-schemas expl 'URL schema' compadd -S '' - \ | |
310 | http:// https:// ssh:// bundle:// |
|
328 | http:// https:// ssh:// bundle:// | |
311 | fi |
|
329 | fi | |
312 | } |
|
330 | } | |
313 |
|
331 | |||
314 | _hg_paths() { |
|
332 | _hg_paths() { | |
315 | typeset -a paths pnames |
|
333 | typeset -a paths pnames | |
316 | _hg_cmd paths | while read -A pnames |
|
334 | _hg_cmd paths | while read -A pnames | |
317 | do |
|
335 | do | |
318 | paths+=($pnames[1]) |
|
336 | paths+=($pnames[1]) | |
319 | done |
|
337 | done | |
320 | (( $#paths )) && _describe -t path-aliases 'repository alias' paths |
|
338 | (( $#paths )) && _describe -t path-aliases 'repository alias' paths | |
321 | } |
|
339 | } | |
322 |
|
340 | |||
323 | _hg_remote() { |
|
341 | _hg_remote() { | |
324 | _alternative 'path-aliases:repository alias:_hg_paths' \ |
|
342 | _alternative 'path-aliases:repository alias:_hg_paths' \ | |
325 | 'directories:directory:_files -/' \ |
|
343 | 'directories:directory:_files -/' \ | |
326 | 'urls:URL:_hg_urls' |
|
344 | 'urls:URL:_hg_urls' | |
327 | } |
|
345 | } | |
328 |
|
346 | |||
329 | _hg_clone_dest() { |
|
347 | _hg_clone_dest() { | |
330 | _alternative 'directories:directory:_files -/' \ |
|
348 | _alternative 'directories:directory:_files -/' \ | |
331 | 'urls:URL:_hg_urls' |
|
349 | 'urls:URL:_hg_urls' | |
332 | } |
|
350 | } | |
333 |
|
351 | |||
334 | # Common options |
|
352 | # Common options | |
335 | _hg_global_opts=( |
|
353 | _hg_global_opts=( | |
336 | '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
|
354 | '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' | |
337 | '--cwd[change working directory]:new working directory:_files -/' |
|
355 | '--cwd[change working directory]:new working directory:_files -/' | |
338 | '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' |
|
356 | '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' | |
339 | '(--verbose -v)'{-v,--verbose}'[enable additional output]' |
|
357 | '(--verbose -v)'{-v,--verbose}'[enable additional output]' | |
340 | '*--config[set/override config option]:defined config items:_hg_config' |
|
358 | '*--config[set/override config option]:defined config items:_hg_config' | |
341 | '(--quiet -q)'{-q,--quiet}'[suppress output]' |
|
359 | '(--quiet -q)'{-q,--quiet}'[suppress output]' | |
342 | '(--help -h)'{-h,--help}'[display help and exit]' |
|
360 | '(--help -h)'{-h,--help}'[display help and exit]' | |
343 | '--debug[debug mode]' |
|
361 | '--debug[debug mode]' | |
344 | '--debugger[start debugger]' |
|
362 | '--debugger[start debugger]' | |
345 | '--encoding[set the charset encoding (default: UTF8)]' |
|
363 | '--encoding[set the charset encoding (default: UTF8)]' | |
346 | '--encodingmode[set the charset encoding mode (default: strict)]' |
|
364 | '--encodingmode[set the charset encoding mode (default: strict)]' | |
347 | '--lsprof[print improved command execution profile]' |
|
365 | '--lsprof[print improved command execution profile]' | |
348 | '--traceback[print traceback on exception]' |
|
366 | '--traceback[print traceback on exception]' | |
349 | '--time[time how long the command takes]' |
|
367 | '--time[time how long the command takes]' | |
350 | '--profile[profile]' |
|
368 | '--profile[profile]' | |
351 | '--version[output version information and exit]' |
|
369 | '--version[output version information and exit]' | |
352 | ) |
|
370 | ) | |
353 |
|
371 | |||
354 | _hg_pat_opts=( |
|
372 | _hg_pat_opts=( | |
355 | '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' |
|
373 | '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/' | |
356 | '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
|
374 | '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') | |
357 |
|
375 | |||
358 | _hg_diff_opts=( |
|
376 | _hg_diff_opts=( | |
359 | '(--text -a)'{-a,--text}'[treat all files as text]' |
|
377 | '(--text -a)'{-a,--text}'[treat all files as text]' | |
360 | '(--git -g)'{-g,--git}'[use git extended diff format]' |
|
378 | '(--git -g)'{-g,--git}'[use git extended diff format]' | |
361 | "--nodates[omit dates from diff headers]") |
|
379 | "--nodates[omit dates from diff headers]") | |
362 |
|
380 | |||
363 | _hg_dryrun_opts=( |
|
381 | _hg_dryrun_opts=( | |
364 | '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
|
382 | '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') | |
365 |
|
383 | |||
366 | _hg_style_opts=( |
|
384 | _hg_style_opts=( | |
367 | '--style[display using template map file]:' |
|
385 | '--style[display using template map file]:' | |
368 | '--template[display with template]:') |
|
386 | '--template[display with template]:') | |
369 |
|
387 | |||
370 | _hg_commit_opts=( |
|
388 | _hg_commit_opts=( | |
371 | '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' |
|
389 | '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]' | |
372 | '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:' |
|
390 | '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:' | |
373 | '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') |
|
391 | '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') | |
374 |
|
392 | |||
375 | _hg_remote_opts=( |
|
393 | _hg_remote_opts=( | |
376 | '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
|
394 | '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' | |
377 | '--remotecmd[specify hg command to run on the remote side]:') |
|
395 | '--remotecmd[specify hg command to run on the remote side]:') | |
378 |
|
396 | |||
379 | _hg_cmd() { |
|
397 | _hg_cmd() { | |
380 | _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null |
|
398 | _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null | |
381 | } |
|
399 | } | |
382 |
|
400 | |||
383 | _hg_cmd_add() { |
|
401 | _hg_cmd_add() { | |
384 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
402 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
385 | '*:unknown files:_hg_unknown' |
|
403 | '*:unknown files:_hg_unknown' | |
386 | } |
|
404 | } | |
387 |
|
405 | |||
388 | _hg_cmd_addremove() { |
|
406 | _hg_cmd_addremove() { | |
389 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
407 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
390 | '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ |
|
408 | '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ | |
391 | '*:unknown or missing files:_hg_addremove' |
|
409 | '*:unknown or missing files:_hg_addremove' | |
392 | } |
|
410 | } | |
393 |
|
411 | |||
394 | _hg_cmd_annotate() { |
|
412 | _hg_cmd_annotate() { | |
395 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
413 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
396 |
'(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_ |
|
414 | '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_labels' \ | |
397 | '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ |
|
415 | '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \ | |
398 | '(--text -a)'{-a,--text}'[treat all files as text]' \ |
|
416 | '(--text -a)'{-a,--text}'[treat all files as text]' \ | |
399 | '(--user -u)'{-u,--user}'[list the author]' \ |
|
417 | '(--user -u)'{-u,--user}'[list the author]' \ | |
400 | '(--date -d)'{-d,--date}'[list the date]' \ |
|
418 | '(--date -d)'{-d,--date}'[list the date]' \ | |
401 | '(--number -n)'{-n,--number}'[list the revision number (default)]' \ |
|
419 | '(--number -n)'{-n,--number}'[list the revision number (default)]' \ | |
402 | '(--changeset -c)'{-c,--changeset}'[list the changeset]' \ |
|
420 | '(--changeset -c)'{-c,--changeset}'[list the changeset]' \ | |
403 | '*:files:_hg_files' |
|
421 | '*:files:_hg_files' | |
404 | } |
|
422 | } | |
405 |
|
423 | |||
406 | _hg_cmd_archive() { |
|
424 | _hg_cmd_archive() { | |
407 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
425 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
408 | '--no-decode[do not pass files through decoders]' \ |
|
426 | '--no-decode[do not pass files through decoders]' \ | |
409 | '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ |
|
427 | '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ | |
410 |
'(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_ |
|
428 | '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \ | |
411 | '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ |
|
429 | '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ | |
412 | '*:destination:_files' |
|
430 | '*:destination:_files' | |
413 | } |
|
431 | } | |
414 |
|
432 | |||
415 | _hg_cmd_backout() { |
|
433 | _hg_cmd_backout() { | |
416 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
434 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
417 | '--merge[merge with old dirstate parent after backout]' \ |
|
435 | '--merge[merge with old dirstate parent after backout]' \ | |
418 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
|
436 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ | |
419 | '--parent[parent to choose when backing out merge]' \ |
|
437 | '--parent[parent to choose when backing out merge]' \ | |
420 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
|
438 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ | |
421 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_ |
|
439 | '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ | |
422 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
|
440 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ | |
423 | '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' |
|
441 | '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' | |
424 | } |
|
442 | } | |
425 |
|
443 | |||
426 | _hg_cmd_bisect() { |
|
444 | _hg_cmd_bisect() { | |
427 | _arguments -s -w : $_hg_global_opts \ |
|
445 | _arguments -s -w : $_hg_global_opts \ | |
428 | '(-)'{-r,--reset}'[reset bisect state]' \ |
|
446 | '(-)'{-r,--reset}'[reset bisect state]' \ | |
429 |
'(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_ |
|
447 | '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \ | |
430 |
'(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_ |
|
448 | '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \ | |
431 | '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ |
|
449 | '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ | |
432 | '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ |
|
450 | '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ | |
433 | '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' |
|
451 | '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' | |
434 | } |
|
452 | } | |
435 |
|
453 | |||
|
454 | _hg_cmd_bookmarks() { | |||
|
455 | _arguments -s -w : $_hg_global_opts \ | |||
|
456 | '(--force -f)'{-f,--force}'[force]' \ | |||
|
457 | '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \ | |||
|
458 | '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \ | |||
|
459 | '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ | |||
|
460 | ':bookmark:_hg_bookmarks' | |||
|
461 | } | |||
|
462 | ||||
436 | _hg_cmd_branch() { |
|
463 | _hg_cmd_branch() { | |
437 | _arguments -s -w : $_hg_global_opts \ |
|
464 | _arguments -s -w : $_hg_global_opts \ | |
438 | '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ |
|
465 | '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ | |
439 | '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' |
|
466 | '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' | |
440 | } |
|
467 | } | |
441 |
|
468 | |||
442 | _hg_cmd_branches() { |
|
469 | _hg_cmd_branches() { | |
443 | _arguments -s -w : $_hg_global_opts \ |
|
470 | _arguments -s -w : $_hg_global_opts \ | |
444 | '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' |
|
471 | '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' | |
445 | } |
|
472 | } | |
446 |
|
473 | |||
447 | _hg_cmd_bundle() { |
|
474 | _hg_cmd_bundle() { | |
448 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
475 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
449 | '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
|
476 | '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ | |
450 |
'(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_ |
|
477 | '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \ | |
451 | ':output file:_files' \ |
|
478 | ':output file:_files' \ | |
452 | ':destination repository:_files -/' |
|
479 | ':destination repository:_files -/' | |
453 | } |
|
480 | } | |
454 |
|
481 | |||
455 | _hg_cmd_cat() { |
|
482 | _hg_cmd_cat() { | |
456 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
483 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
457 | '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
|
484 | '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ | |
458 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_ |
|
485 | '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ | |
459 | '*:file:_hg_files' |
|
486 | '*:file:_hg_files' | |
460 | } |
|
487 | } | |
461 |
|
488 | |||
462 | _hg_cmd_clone() { |
|
489 | _hg_cmd_clone() { | |
463 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
490 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
464 | '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ |
|
491 | '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \ | |
465 | '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ |
|
492 | '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ | |
466 | '--uncompressed[use uncompressed transfer (fast over LAN)]' \ |
|
493 | '--uncompressed[use uncompressed transfer (fast over LAN)]' \ | |
467 | ':source repository:_hg_remote' \ |
|
494 | ':source repository:_hg_remote' \ | |
468 | ':destination:_hg_clone_dest' |
|
495 | ':destination:_hg_clone_dest' | |
469 | } |
|
496 | } | |
470 |
|
497 | |||
471 | _hg_cmd_commit() { |
|
498 | _hg_cmd_commit() { | |
472 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
499 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
473 | '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ |
|
500 | '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ | |
474 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
|
501 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ | |
475 | '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \ |
|
502 | '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \ | |
476 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
|
503 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ | |
477 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
|
504 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ | |
478 | '*:file:_hg_files' |
|
505 | '*:file:_hg_files' | |
479 | } |
|
506 | } | |
480 |
|
507 | |||
481 | _hg_cmd_copy() { |
|
508 | _hg_cmd_copy() { | |
482 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
509 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
483 | '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ |
|
510 | '(--after -A)'{-A,--after}'[record a copy that has already occurred]' \ | |
484 | '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
|
511 | '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ | |
485 | '*:file:_hg_files' |
|
512 | '*:file:_hg_files' | |
486 | } |
|
513 | } | |
487 |
|
514 | |||
488 | _hg_cmd_diff() { |
|
515 | _hg_cmd_diff() { | |
489 | typeset -A opt_args |
|
516 | typeset -A opt_args | |
490 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ |
|
517 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ | |
491 | '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ |
|
518 | '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ | |
492 | '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ |
|
519 | '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ | |
493 | '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ |
|
520 | '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \ | |
494 | '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ |
|
521 | '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ | |
495 | '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ |
|
522 | '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ | |
496 | '*:file:->diff_files' |
|
523 | '*:file:->diff_files' | |
497 |
|
524 | |||
498 | if [[ $state == 'diff_files' ]] |
|
525 | if [[ $state == 'diff_files' ]] | |
499 | then |
|
526 | then | |
500 | if [[ -n $opt_args[-r] ]] |
|
527 | if [[ -n $opt_args[-r] ]] | |
501 | then |
|
528 | then | |
502 | _hg_files |
|
529 | _hg_files | |
503 | else |
|
530 | else | |
504 | _hg_modified |
|
531 | _hg_modified | |
505 | fi |
|
532 | fi | |
506 | fi |
|
533 | fi | |
507 | } |
|
534 | } | |
508 |
|
535 | |||
509 | _hg_cmd_export() { |
|
536 | _hg_cmd_export() { | |
510 | _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ |
|
537 | _arguments -s -w : $_hg_global_opts $_hg_diff_opts \ | |
511 | '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
|
538 | '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ | |
512 | '--switch-parent[diff against the second parent]' \ |
|
539 | '--switch-parent[diff against the second parent]' \ | |
513 |
'*:revision:_hg_ |
|
540 | '*:revision:_hg_labels' | |
514 | } |
|
541 | } | |
515 |
|
542 | |||
516 | _hg_cmd_grep() { |
|
543 | _hg_cmd_grep() { | |
517 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
544 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
518 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ |
|
545 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ | |
519 | '--all[print all revisions with matches]' \ |
|
546 | '--all[print all revisions with matches]' \ | |
520 | '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ |
|
547 | '(--follow -f)'{-f,--follow}'[follow changeset or file history]' \ | |
521 | '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ |
|
548 | '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \ | |
522 | '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ |
|
549 | '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \ | |
523 | '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ |
|
550 | '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ | |
524 | '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ |
|
551 | '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ | |
525 | '(--user -u)'{-u,--user}'[print user who committed change]' \ |
|
552 | '(--user -u)'{-u,--user}'[print user who committed change]' \ | |
526 | '1:search pattern:' \ |
|
553 | '1:search pattern:' \ | |
527 | '*:files:_hg_files' |
|
554 | '*:files:_hg_files' | |
528 | } |
|
555 | } | |
529 |
|
556 | |||
530 | _hg_cmd_heads() { |
|
557 | _hg_cmd_heads() { | |
531 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
558 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
532 |
'(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_ |
|
559 | '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels' | |
533 | } |
|
560 | } | |
534 |
|
561 | |||
535 | _hg_cmd_help() { |
|
562 | _hg_cmd_help() { | |
536 | _arguments -s -w : $_hg_global_opts \ |
|
563 | _arguments -s -w : $_hg_global_opts \ | |
537 | '*:mercurial command:_hg_commands' |
|
564 | '*:mercurial command:_hg_commands' | |
538 | } |
|
565 | } | |
539 |
|
566 | |||
540 | _hg_cmd_identify() { |
|
567 | _hg_cmd_identify() { | |
541 | _arguments -s -w : $_hg_global_opts \ |
|
568 | _arguments -s -w : $_hg_global_opts \ | |
542 |
'(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_ |
|
569 | '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \ | |
543 | '(--num -n)'{-n+,--num}'[show local revision number]' \ |
|
570 | '(--num -n)'{-n+,--num}'[show local revision number]' \ | |
544 | '(--id -i)'{-i+,--id}'[show global revision id]' \ |
|
571 | '(--id -i)'{-i+,--id}'[show global revision id]' \ | |
545 | '(--branch -b)'{-b+,--branch}'[show branch]' \ |
|
572 | '(--branch -b)'{-b+,--branch}'[show branch]' \ | |
546 | '(--tags -t)'{-t+,--tags}'[show tags]' |
|
573 | '(--tags -t)'{-t+,--tags}'[show tags]' | |
547 | } |
|
574 | } | |
548 |
|
575 | |||
549 | _hg_cmd_import() { |
|
576 | _hg_cmd_import() { | |
550 | _arguments -s -w : $_hg_global_opts \ |
|
577 | _arguments -s -w : $_hg_global_opts \ | |
551 | '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ |
|
578 | '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ | |
552 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
|
579 | '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ | |
553 | '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ |
|
580 | '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ | |
554 | '*:patch:_files' |
|
581 | '*:patch:_files' | |
555 | } |
|
582 | } | |
556 |
|
583 | |||
557 | _hg_cmd_incoming() { |
|
584 | _hg_cmd_incoming() { | |
558 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
|
585 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ | |
559 | '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
|
586 | '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ | |
560 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
|
587 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ | |
561 | '(--patch -p)'{-p,--patch}'[show patch]' \ |
|
588 | '(--patch -p)'{-p,--patch}'[show patch]' \ | |
562 | '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ |
|
589 | '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ | |
563 | '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
|
590 | '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ | |
564 | '--bundle[file to store the bundles into]:bundle file:_files' \ |
|
591 | '--bundle[file to store the bundles into]:bundle file:_files' \ | |
565 | ':source:_hg_remote' |
|
592 | ':source:_hg_remote' | |
566 | } |
|
593 | } | |
567 |
|
594 | |||
568 | _hg_cmd_init() { |
|
595 | _hg_cmd_init() { | |
569 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
596 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
570 | ':dir:_files -/' |
|
597 | ':dir:_files -/' | |
571 | } |
|
598 | } | |
572 |
|
599 | |||
573 | _hg_cmd_locate() { |
|
600 | _hg_cmd_locate() { | |
574 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
601 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
575 |
'(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_ |
|
602 | '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_labels' \ | |
576 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
|
603 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ | |
577 | '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ |
|
604 | '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ | |
578 | '*:search pattern:_hg_files' |
|
605 | '*:search pattern:_hg_files' | |
579 | } |
|
606 | } | |
580 |
|
607 | |||
581 | _hg_cmd_log() { |
|
608 | _hg_cmd_log() { | |
582 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ |
|
609 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \ | |
583 | '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ |
|
610 | '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ | |
584 | '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ |
|
611 | '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \ | |
585 | '(--copies -C)'{-C,--copies}'[show copied files]' \ |
|
612 | '(--copies -C)'{-C,--copies}'[show copied files]' \ | |
586 | '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ |
|
613 | '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ | |
587 | '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
|
614 | '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ | |
588 | '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ |
|
615 | '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ | |
589 | '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ |
|
616 | '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \ | |
590 | '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ |
|
617 | '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ | |
591 | '(--patch -p)'{-p,--patch}'[show patch]' \ |
|
618 | '(--patch -p)'{-p,--patch}'[show patch]' \ | |
592 |
'(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_ |
|
619 | '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \ | |
593 | '*:files:_hg_files' |
|
620 | '*:files:_hg_files' | |
594 | } |
|
621 | } | |
595 |
|
622 | |||
596 | _hg_cmd_manifest() { |
|
623 | _hg_cmd_manifest() { | |
597 | _arguments -s -w : $_hg_global_opts \ |
|
624 | _arguments -s -w : $_hg_global_opts \ | |
598 |
':revision:_hg_ |
|
625 | ':revision:_hg_labels' | |
599 | } |
|
626 | } | |
600 |
|
627 | |||
601 | _hg_cmd_merge() { |
|
628 | _hg_cmd_merge() { | |
602 | _arguments -s -w : $_hg_global_opts \ |
|
629 | _arguments -s -w : $_hg_global_opts \ | |
603 | '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ |
|
630 | '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ | |
604 | '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ |
|
631 | '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ | |
605 | '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ |
|
632 | '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ | |
606 | ':revision:_hg_mergerevs' |
|
633 | ':revision:_hg_mergerevs' | |
607 | } |
|
634 | } | |
608 |
|
635 | |||
609 | _hg_cmd_outgoing() { |
|
636 | _hg_cmd_outgoing() { | |
610 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
|
637 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ | |
611 | '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
|
638 | '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ | |
612 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
|
639 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ | |
613 | '(--patch -p)'{-p,--patch}'[show patch]' \ |
|
640 | '(--patch -p)'{-p,--patch}'[show patch]' \ | |
614 | '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ |
|
641 | '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \ | |
615 | '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
|
642 | '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ | |
616 | ':destination:_hg_remote' |
|
643 | ':destination:_hg_remote' | |
617 | } |
|
644 | } | |
618 |
|
645 | |||
619 | _hg_cmd_parents() { |
|
646 | _hg_cmd_parents() { | |
620 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
647 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
621 |
'(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_ |
|
648 | '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_labels' \ | |
622 | ':last modified file:_hg_files' |
|
649 | ':last modified file:_hg_files' | |
623 | } |
|
650 | } | |
624 |
|
651 | |||
625 | _hg_cmd_paths() { |
|
652 | _hg_cmd_paths() { | |
626 | _arguments -s -w : $_hg_global_opts \ |
|
653 | _arguments -s -w : $_hg_global_opts \ | |
627 | ':path:_hg_paths' |
|
654 | ':path:_hg_paths' | |
628 | } |
|
655 | } | |
629 |
|
656 | |||
630 | _hg_cmd_pull() { |
|
657 | _hg_cmd_pull() { | |
631 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
658 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
632 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
|
659 | '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ | |
633 | '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ |
|
660 | '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ | |
634 | '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ |
|
661 | '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ | |
635 | ':source:_hg_remote' |
|
662 | ':source:_hg_remote' | |
636 | } |
|
663 | } | |
637 |
|
664 | |||
638 | _hg_cmd_push() { |
|
665 | _hg_cmd_push() { | |
639 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
666 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
640 | '(--force -f)'{-f,--force}'[force push]' \ |
|
667 | '(--force -f)'{-f,--force}'[force push]' \ | |
641 |
'(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_ |
|
668 | '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \ | |
642 | ':destination:_hg_remote' |
|
669 | ':destination:_hg_remote' | |
643 | } |
|
670 | } | |
644 |
|
671 | |||
645 | _hg_cmd_remove() { |
|
672 | _hg_cmd_remove() { | |
646 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
673 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
647 | '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ |
|
674 | '(--after -A)'{-A,--after}'[record remove that has already occurred]' \ | |
648 | '(--force -f)'{-f,--force}'[remove file even if modified]' \ |
|
675 | '(--force -f)'{-f,--force}'[remove file even if modified]' \ | |
649 | '*:file:_hg_files' |
|
676 | '*:file:_hg_files' | |
650 | } |
|
677 | } | |
651 |
|
678 | |||
652 | _hg_cmd_rename() { |
|
679 | _hg_cmd_rename() { | |
653 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
680 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
654 | '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ |
|
681 | '(--after -A)'{-A,--after}'[record a rename that has already occurred]' \ | |
655 | '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
|
682 | '(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ | |
656 | '*:file:_hg_files' |
|
683 | '*:file:_hg_files' | |
657 | } |
|
684 | } | |
658 |
|
685 | |||
659 | _hg_cmd_resolve() { |
|
686 | _hg_cmd_resolve() { | |
660 | local context state line |
|
687 | local context state line | |
661 | typeset -A opt_args |
|
688 | typeset -A opt_args | |
662 |
|
689 | |||
663 | _arguments -s -w : $_hg_global_opts \ |
|
690 | _arguments -s -w : $_hg_global_opts \ | |
664 | '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ |
|
691 | '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ | |
665 | '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ |
|
692 | '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ | |
666 | '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ |
|
693 | '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ | |
667 | '*:file:_hg_unresolved' |
|
694 | '*:file:_hg_unresolved' | |
668 |
|
695 | |||
669 | if [[ $state == 'resolve_files' ]] |
|
696 | if [[ $state == 'resolve_files' ]] | |
670 | then |
|
697 | then | |
671 | _alternative 'files:resolved files:_hg_resolved' \ |
|
698 | _alternative 'files:resolved files:_hg_resolved' \ | |
672 | 'files:unresolved files:_hg_unresolved' |
|
699 | 'files:unresolved files:_hg_unresolved' | |
673 | fi |
|
700 | fi | |
674 | } |
|
701 | } | |
675 |
|
702 | |||
676 | _hg_cmd_revert() { |
|
703 | _hg_cmd_revert() { | |
677 | local context state line |
|
704 | local context state line | |
678 | typeset -A opt_args |
|
705 | typeset -A opt_args | |
679 |
|
706 | |||
680 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
707 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | |
681 | '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ |
|
708 | '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ | |
682 |
'(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_ |
|
709 | '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \ | |
683 | '--no-backup[do not save backup copies of files]' \ |
|
710 | '--no-backup[do not save backup copies of files]' \ | |
684 | '*:file:->diff_files' |
|
711 | '*:file:->diff_files' | |
685 |
|
712 | |||
686 | if [[ $state == 'diff_files' ]] |
|
713 | if [[ $state == 'diff_files' ]] | |
687 | then |
|
714 | then | |
688 | if [[ -n $opt_args[-r] ]] |
|
715 | if [[ -n $opt_args[-r] ]] | |
689 | then |
|
716 | then | |
690 | _hg_files |
|
717 | _hg_files | |
691 | else |
|
718 | else | |
692 | typeset -a status_files |
|
719 | typeset -a status_files | |
693 | _hg_status mard |
|
720 | _hg_status mard | |
694 | _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files |
|
721 | _wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files | |
695 | fi |
|
722 | fi | |
696 | fi |
|
723 | fi | |
697 | } |
|
724 | } | |
698 |
|
725 | |||
699 | _hg_cmd_serve() { |
|
726 | _hg_cmd_serve() { | |
700 | _arguments -s -w : $_hg_global_opts \ |
|
727 | _arguments -s -w : $_hg_global_opts \ | |
701 | '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ |
|
728 | '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \ | |
702 | '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ |
|
729 | '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \ | |
703 | '(--daemon -d)'{-d,--daemon}'[run server in background]' \ |
|
730 | '(--daemon -d)'{-d,--daemon}'[run server in background]' \ | |
704 | '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ |
|
731 | '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ | |
705 | '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ |
|
732 | '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ | |
706 | '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ |
|
733 | '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \ | |
707 | '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ |
|
734 | '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ | |
708 | '--style[web template style]:style' \ |
|
735 | '--style[web template style]:style' \ | |
709 | '--stdio[for remote clients]' \ |
|
736 | '--stdio[for remote clients]' \ | |
710 | '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' |
|
737 | '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' | |
711 | } |
|
738 | } | |
712 |
|
739 | |||
713 | _hg_cmd_showconfig() { |
|
740 | _hg_cmd_showconfig() { | |
714 | _arguments -s -w : $_hg_global_opts \ |
|
741 | _arguments -s -w : $_hg_global_opts \ | |
715 | '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ |
|
742 | '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ | |
716 | ':config item:_hg_config' |
|
743 | ':config item:_hg_config' | |
717 | } |
|
744 | } | |
718 |
|
745 | |||
719 | _hg_cmd_status() { |
|
746 | _hg_cmd_status() { | |
720 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
747 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
721 | '(--all -A)'{-A,--all}'[show status of all files]' \ |
|
748 | '(--all -A)'{-A,--all}'[show status of all files]' \ | |
722 | '(--modified -m)'{-m,--modified}'[show only modified files]' \ |
|
749 | '(--modified -m)'{-m,--modified}'[show only modified files]' \ | |
723 | '(--added -a)'{-a,--added}'[show only added files]' \ |
|
750 | '(--added -a)'{-a,--added}'[show only added files]' \ | |
724 | '(--removed -r)'{-r,--removed}'[show only removed files]' \ |
|
751 | '(--removed -r)'{-r,--removed}'[show only removed files]' \ | |
725 | '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ |
|
752 | '(--deleted -d)'{-d,--deleted}'[show only deleted (but tracked) files]' \ | |
726 | '(--clean -c)'{-c,--clean}'[show only files without changes]' \ |
|
753 | '(--clean -c)'{-c,--clean}'[show only files without changes]' \ | |
727 | '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ |
|
754 | '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ | |
728 | '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ |
|
755 | '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ | |
729 | '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ |
|
756 | '(--no-status -n)'{-n,--no-status}'[hide status prefix]' \ | |
730 | '(--copies -C)'{-C,--copies}'[show source of copied files]' \ |
|
757 | '(--copies -C)'{-C,--copies}'[show source of copied files]' \ | |
731 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
|
758 | '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ | |
732 |
'--rev[show difference from revision]:revision:_hg_ |
|
759 | '--rev[show difference from revision]:revision:_hg_labels' \ | |
733 | '*:files:_files' |
|
760 | '*:files:_files' | |
734 | } |
|
761 | } | |
735 |
|
762 | |||
736 | _hg_cmd_summary() { |
|
763 | _hg_cmd_summary() { | |
737 | _arguments -s -w : $_hg_global_opts \ |
|
764 | _arguments -s -w : $_hg_global_opts \ | |
738 | '--remote[check for push and pull]' |
|
765 | '--remote[check for push and pull]' | |
739 | } |
|
766 | } | |
740 |
|
767 | |||
741 | _hg_cmd_tag() { |
|
768 | _hg_cmd_tag() { | |
742 | _arguments -s -w : $_hg_global_opts \ |
|
769 | _arguments -s -w : $_hg_global_opts \ | |
743 | '(--local -l)'{-l,--local}'[make the tag local]' \ |
|
770 | '(--local -l)'{-l,--local}'[make the tag local]' \ | |
744 | '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ |
|
771 | '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ | |
745 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
|
772 | '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ | |
746 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
|
773 | '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ | |
747 |
'(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_ |
|
774 | '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \ | |
748 | ':tag name:' |
|
775 | ':tag name:' | |
749 | } |
|
776 | } | |
750 |
|
777 | |||
751 | _hg_cmd_tip() { |
|
778 | _hg_cmd_tip() { | |
752 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ |
|
779 | _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
753 | '(--patch -p)'{-p,--patch}'[show patch]' |
|
780 | '(--patch -p)'{-p,--patch}'[show patch]' | |
754 | } |
|
781 | } | |
755 |
|
782 | |||
756 | _hg_cmd_unbundle() { |
|
783 | _hg_cmd_unbundle() { | |
757 | _arguments -s -w : $_hg_global_opts \ |
|
784 | _arguments -s -w : $_hg_global_opts \ | |
758 | '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ |
|
785 | '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ | |
759 | ':files:_files' |
|
786 | ':files:_files' | |
760 | } |
|
787 | } | |
761 |
|
788 | |||
762 | _hg_cmd_update() { |
|
789 | _hg_cmd_update() { | |
763 | _arguments -s -w : $_hg_global_opts \ |
|
790 | _arguments -s -w : $_hg_global_opts \ | |
764 | '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
|
791 | '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ | |
765 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_ |
|
792 | '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ | |
766 |
':revision:_hg_ |
|
793 | ':revision:_hg_labels' | |
767 | } |
|
794 | } | |
768 |
|
795 | |||
769 | ## extensions ## |
|
796 | ## extensions ## | |
770 |
|
797 | |||
771 | # bookmarks |
|
|||
772 | _hg_bookmarks() { |
|
|||
773 | typeset -a bookmark bookmarks |
|
|||
774 |
|
||||
775 | _hg_cmd bookmarks | while read -A bookmark |
|
|||
776 | do |
|
|||
777 | if test -z ${bookmark[-1]:#[0-9]*} |
|
|||
778 | then |
|
|||
779 | bookmarks+=($bookmark[-2]) |
|
|||
780 | fi |
|
|||
781 | done |
|
|||
782 | (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks |
|
|||
783 | } |
|
|||
784 |
|
||||
785 | _hg_cmd_bookmarks() { |
|
|||
786 | _arguments -s -w : $_hg_global_opts \ |
|
|||
787 | '(--force -f)'{-f,--force}'[force]' \ |
|
|||
788 | '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
|
|||
789 | '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \ |
|
|||
790 | '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ |
|
|||
791 | ':bookmark:_hg_bookmarks' |
|
|||
792 | } |
|
|||
793 |
|
||||
794 | # HGK |
|
798 | # HGK | |
795 | _hg_cmd_view() { |
|
799 | _hg_cmd_view() { | |
796 | _arguments -s -w : $_hg_global_opts \ |
|
800 | _arguments -s -w : $_hg_global_opts \ | |
797 | '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
|
801 | '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ | |
798 | ':revision range:_hg_tags' |
|
802 | ':revision range:_hg_tags' | |
799 | } |
|
803 | } | |
800 |
|
804 | |||
801 | # MQ |
|
805 | # MQ | |
802 | _hg_qseries() { |
|
806 | _hg_qseries() { | |
803 | typeset -a patches |
|
807 | typeset -a patches | |
804 | patches=(${(f)"$(_hg_cmd qseries)"}) |
|
808 | patches=(${(f)"$(_hg_cmd qseries)"}) | |
805 | (( $#patches )) && _describe -t hg-patches 'patches' patches |
|
809 | (( $#patches )) && _describe -t hg-patches 'patches' patches | |
806 | } |
|
810 | } | |
807 |
|
811 | |||
808 | _hg_qapplied() { |
|
812 | _hg_qapplied() { | |
809 | typeset -a patches |
|
813 | typeset -a patches | |
810 | patches=(${(f)"$(_hg_cmd qapplied)"}) |
|
814 | patches=(${(f)"$(_hg_cmd qapplied)"}) | |
811 | if (( $#patches )) |
|
815 | if (( $#patches )) | |
812 | then |
|
816 | then | |
813 | patches+=(qbase qtip) |
|
817 | patches+=(qbase qtip) | |
814 | _describe -t hg-applied-patches 'applied patches' patches |
|
818 | _describe -t hg-applied-patches 'applied patches' patches | |
815 | fi |
|
819 | fi | |
816 | } |
|
820 | } | |
817 |
|
821 | |||
818 | _hg_qunapplied() { |
|
822 | _hg_qunapplied() { | |
819 | typeset -a patches |
|
823 | typeset -a patches | |
820 | patches=(${(f)"$(_hg_cmd qunapplied)"}) |
|
824 | patches=(${(f)"$(_hg_cmd qunapplied)"}) | |
821 | (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
|
825 | (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches | |
822 | } |
|
826 | } | |
823 |
|
827 | |||
824 | # unapplied, including guarded patches |
|
828 | # unapplied, including guarded patches | |
825 | _hg_qdeletable() { |
|
829 | _hg_qdeletable() { | |
826 | typeset -a unapplied |
|
830 | typeset -a unapplied | |
827 | unapplied=(${(f)"$(_hg_cmd qseries)"}) |
|
831 | unapplied=(${(f)"$(_hg_cmd qseries)"}) | |
828 | for p in $(_hg_cmd qapplied) |
|
832 | for p in $(_hg_cmd qapplied) | |
829 | do |
|
833 | do | |
830 | unapplied=(${unapplied:#$p}) |
|
834 | unapplied=(${unapplied:#$p}) | |
831 | done |
|
835 | done | |
832 |
|
836 | |||
833 | (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied |
|
837 | (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied | |
834 | } |
|
838 | } | |
835 |
|
839 | |||
836 | _hg_qguards() { |
|
840 | _hg_qguards() { | |
837 | typeset -a guards |
|
841 | typeset -a guards | |
838 | local guard |
|
842 | local guard | |
839 | compset -P "+|-" |
|
843 | compset -P "+|-" | |
840 | _hg_cmd qselect -s | while read guard |
|
844 | _hg_cmd qselect -s | while read guard | |
841 | do |
|
845 | do | |
842 | guards+=(${guard#(+|-)}) |
|
846 | guards+=(${guard#(+|-)}) | |
843 | done |
|
847 | done | |
844 | (( $#guards )) && _describe -t hg-guards 'guards' guards |
|
848 | (( $#guards )) && _describe -t hg-guards 'guards' guards | |
845 | } |
|
849 | } | |
846 |
|
850 | |||
847 | _hg_qseries_opts=( |
|
851 | _hg_qseries_opts=( | |
848 | '(--summary -s)'{-s,--summary}'[print first line of patch header]') |
|
852 | '(--summary -s)'{-s,--summary}'[print first line of patch header]') | |
849 |
|
853 | |||
850 | _hg_cmd_qapplied() { |
|
854 | _hg_cmd_qapplied() { | |
851 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
855 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts | |
852 | } |
|
856 | } | |
853 |
|
857 | |||
854 | _hg_cmd_qdelete() { |
|
858 | _hg_cmd_qdelete() { | |
855 | _arguments -s -w : $_hg_global_opts \ |
|
859 | _arguments -s -w : $_hg_global_opts \ | |
856 | '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
|
860 | '(--keep -k)'{-k,--keep}'[keep patch file]' \ | |
857 | '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ |
|
861 | '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ | |
858 | '*:unapplied patch:_hg_qdeletable' |
|
862 | '*:unapplied patch:_hg_qdeletable' | |
859 | } |
|
863 | } | |
860 |
|
864 | |||
861 | _hg_cmd_qdiff() { |
|
865 | _hg_cmd_qdiff() { | |
862 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
866 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
863 | '*:pattern:_hg_files' |
|
867 | '*:pattern:_hg_files' | |
864 | } |
|
868 | } | |
865 |
|
869 | |||
866 | _hg_cmd_qfold() { |
|
870 | _hg_cmd_qfold() { | |
867 | _arguments -s -w : $_hg_global_opts $_h_commit_opts \ |
|
871 | _arguments -s -w : $_hg_global_opts $_h_commit_opts \ | |
868 | '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ |
|
872 | '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ | |
869 | '*:unapplied patch:_hg_qunapplied' |
|
873 | '*:unapplied patch:_hg_qunapplied' | |
870 | } |
|
874 | } | |
871 |
|
875 | |||
872 | _hg_cmd_qgoto() { |
|
876 | _hg_cmd_qgoto() { | |
873 | _arguments -s -w : $_hg_global_opts \ |
|
877 | _arguments -s -w : $_hg_global_opts \ | |
874 | '(--force -f)'{-f,--force}'[overwrite any local changes]' \ |
|
878 | '(--force -f)'{-f,--force}'[overwrite any local changes]' \ | |
875 | ':patch:_hg_qseries' |
|
879 | ':patch:_hg_qseries' | |
876 | } |
|
880 | } | |
877 |
|
881 | |||
878 | _hg_cmd_qguard() { |
|
882 | _hg_cmd_qguard() { | |
879 | _arguments -s -w : $_hg_global_opts \ |
|
883 | _arguments -s -w : $_hg_global_opts \ | |
880 | '(--list -l)'{-l,--list}'[list all patches and guards]' \ |
|
884 | '(--list -l)'{-l,--list}'[list all patches and guards]' \ | |
881 | '(--none -n)'{-n,--none}'[drop all guards]' \ |
|
885 | '(--none -n)'{-n,--none}'[drop all guards]' \ | |
882 | ':patch:_hg_qseries' \ |
|
886 | ':patch:_hg_qseries' \ | |
883 | '*:guards:_hg_qguards' |
|
887 | '*:guards:_hg_qguards' | |
884 | } |
|
888 | } | |
885 |
|
889 | |||
886 | _hg_cmd_qheader() { |
|
890 | _hg_cmd_qheader() { | |
887 | _arguments -s -w : $_hg_global_opts \ |
|
891 | _arguments -s -w : $_hg_global_opts \ | |
888 | ':patch:_hg_qseries' |
|
892 | ':patch:_hg_qseries' | |
889 | } |
|
893 | } | |
890 |
|
894 | |||
891 | _hg_cmd_qimport() { |
|
895 | _hg_cmd_qimport() { | |
892 | _arguments -s -w : $_hg_global_opts \ |
|
896 | _arguments -s -w : $_hg_global_opts \ | |
893 | '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ |
|
897 | '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ | |
894 | '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ |
|
898 | '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ | |
895 | '(--force -f)'{-f,--force}'[overwrite existing files]' \ |
|
899 | '(--force -f)'{-f,--force}'[overwrite existing files]' \ | |
896 | '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ |
|
900 | '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ | |
897 | '*:patch:_files' |
|
901 | '*:patch:_files' | |
898 | } |
|
902 | } | |
899 |
|
903 | |||
900 | _hg_cmd_qnew() { |
|
904 | _hg_cmd_qnew() { | |
901 | _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ |
|
905 | _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ | |
902 | '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
|
906 | '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ | |
903 | ':patch:' |
|
907 | ':patch:' | |
904 | } |
|
908 | } | |
905 |
|
909 | |||
906 | _hg_cmd_qnext() { |
|
910 | _hg_cmd_qnext() { | |
907 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
911 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts | |
908 | } |
|
912 | } | |
909 |
|
913 | |||
910 | _hg_cmd_qpop() { |
|
914 | _hg_cmd_qpop() { | |
911 | _arguments -s -w : $_hg_global_opts \ |
|
915 | _arguments -s -w : $_hg_global_opts \ | |
912 | '(--all -a :)'{-a,--all}'[pop all patches]' \ |
|
916 | '(--all -a :)'{-a,--all}'[pop all patches]' \ | |
913 | '(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
|
917 | '(--name -n)'{-n+,--name}'[queue name to pop]:' \ | |
914 | '(--force -f)'{-f,--force}'[forget any local changes]' \ |
|
918 | '(--force -f)'{-f,--force}'[forget any local changes]' \ | |
915 | ':patch:_hg_qapplied' |
|
919 | ':patch:_hg_qapplied' | |
916 | } |
|
920 | } | |
917 |
|
921 | |||
918 | _hg_cmd_qprev() { |
|
922 | _hg_cmd_qprev() { | |
919 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
923 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts | |
920 | } |
|
924 | } | |
921 |
|
925 | |||
922 | _hg_cmd_qpush() { |
|
926 | _hg_cmd_qpush() { | |
923 | _arguments -s -w : $_hg_global_opts \ |
|
927 | _arguments -s -w : $_hg_global_opts \ | |
924 | '(--all -a :)'{-a,--all}'[apply all patches]' \ |
|
928 | '(--all -a :)'{-a,--all}'[apply all patches]' \ | |
925 | '(--list -l)'{-l,--list}'[list patch name in commit text]' \ |
|
929 | '(--list -l)'{-l,--list}'[list patch name in commit text]' \ | |
926 | '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
|
930 | '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ | |
927 | '(--name -n)'{-n+,--name}'[merge queue name]:' \ |
|
931 | '(--name -n)'{-n+,--name}'[merge queue name]:' \ | |
928 | '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
|
932 | '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ | |
929 | '--move[reorder patch series and apply only the patch]' \ |
|
933 | '--move[reorder patch series and apply only the patch]' \ | |
930 | ':patch:_hg_qunapplied' |
|
934 | ':patch:_hg_qunapplied' | |
931 | } |
|
935 | } | |
932 |
|
936 | |||
933 | _hg_cmd_qrefresh() { |
|
937 | _hg_cmd_qrefresh() { | |
934 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ |
|
938 | _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ | |
935 | '(--git -g)'{-g,--git}'[use git extended diff format]' \ |
|
939 | '(--git -g)'{-g,--git}'[use git extended diff format]' \ | |
936 | '(--short -s)'{-s,--short}'[short refresh]' \ |
|
940 | '(--short -s)'{-s,--short}'[short refresh]' \ | |
937 | '*:files:_hg_files' |
|
941 | '*:files:_hg_files' | |
938 | } |
|
942 | } | |
939 |
|
943 | |||
940 | _hg_cmd_qrename() { |
|
944 | _hg_cmd_qrename() { | |
941 | _arguments -s -w : $_hg_global_opts \ |
|
945 | _arguments -s -w : $_hg_global_opts \ | |
942 | ':patch:_hg_qseries' \ |
|
946 | ':patch:_hg_qseries' \ | |
943 | ':destination:' |
|
947 | ':destination:' | |
944 | } |
|
948 | } | |
945 |
|
949 | |||
946 | _hg_cmd_qselect() { |
|
950 | _hg_cmd_qselect() { | |
947 | _arguments -s -w : $_hg_global_opts \ |
|
951 | _arguments -s -w : $_hg_global_opts \ | |
948 | '(--none -n :)'{-n,--none}'[disable all guards]' \ |
|
952 | '(--none -n :)'{-n,--none}'[disable all guards]' \ | |
949 | '(--series -s :)'{-s,--series}'[list all guards in series file]' \ |
|
953 | '(--series -s :)'{-s,--series}'[list all guards in series file]' \ | |
950 | '--pop[pop to before first guarded applied patch]' \ |
|
954 | '--pop[pop to before first guarded applied patch]' \ | |
951 | '--reapply[pop and reapply patches]' \ |
|
955 | '--reapply[pop and reapply patches]' \ | |
952 | '*:guards:_hg_qguards' |
|
956 | '*:guards:_hg_qguards' | |
953 | } |
|
957 | } | |
954 |
|
958 | |||
955 | _hg_cmd_qseries() { |
|
959 | _hg_cmd_qseries() { | |
956 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ |
|
960 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ | |
957 | '(--missing -m)'{-m,--missing}'[print patches not in series]' |
|
961 | '(--missing -m)'{-m,--missing}'[print patches not in series]' | |
958 | } |
|
962 | } | |
959 |
|
963 | |||
960 | _hg_cmd_qunapplied() { |
|
964 | _hg_cmd_qunapplied() { | |
961 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
965 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts | |
962 | } |
|
966 | } | |
963 |
|
967 | |||
964 | _hg_cmd_qtop() { |
|
968 | _hg_cmd_qtop() { | |
965 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
969 | _arguments -s -w : $_hg_global_opts $_hg_qseries_opts | |
966 | } |
|
970 | } | |
967 |
|
971 | |||
968 | _hg_cmd_strip() { |
|
972 | _hg_cmd_strip() { | |
969 | _arguments -s -w : $_hg_global_opts \ |
|
973 | _arguments -s -w : $_hg_global_opts \ | |
970 | '(--force -f)'{-f,--force}'[force multi-head removal]' \ |
|
974 | '(--force -f)'{-f,--force}'[force multi-head removal]' \ | |
971 | '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
|
975 | '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ | |
972 | '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
|
976 | '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ | |
973 |
':revision:_hg_ |
|
977 | ':revision:_hg_labels' | |
974 | } |
|
978 | } | |
975 |
|
979 | |||
976 | # Patchbomb |
|
980 | # Patchbomb | |
977 | _hg_cmd_email() { |
|
981 | _hg_cmd_email() { | |
978 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
982 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
979 | '(--git -g)'{-g,--git}'[use git extended diff format]' \ |
|
983 | '(--git -g)'{-g,--git}'[use git extended diff format]' \ | |
980 | '--plain[omit hg patch header]' \ |
|
984 | '--plain[omit hg patch header]' \ | |
981 | '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \ |
|
985 | '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \ | |
982 | '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \ |
|
986 | '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \ | |
983 | '--bundlename[name of the bundle attachment file (default: bundle)]:' \ |
|
987 | '--bundlename[name of the bundle attachment file (default: bundle)]:' \ | |
984 | '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ |
|
988 | '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ | |
985 | '--force[run even when remote repository is unrelated (with -b/--bundle)]' \ |
|
989 | '--force[run even when remote repository is unrelated (with -b/--bundle)]' \ | |
986 |
'*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_ |
|
990 | '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_labels' \ | |
987 | '--intro[send an introduction email for a single patch]' \ |
|
991 | '--intro[send an introduction email for a single patch]' \ | |
988 | '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \ |
|
992 | '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \ | |
989 | '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \ |
|
993 | '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \ | |
990 | '*--bcc[email addresses of blind carbon copy recipients]:email:' \ |
|
994 | '*--bcc[email addresses of blind carbon copy recipients]:email:' \ | |
991 | '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \ |
|
995 | '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \ | |
992 | '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \ |
|
996 | '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \ | |
993 | '--date[use the given date as the sending date]:date:' \ |
|
997 | '--date[use the given date as the sending date]:date:' \ | |
994 | '--desc[use the given file as the series description]:files:_files' \ |
|
998 | '--desc[use the given file as the series description]:files:_files' \ | |
995 | '(--from -f)'{-f,--from}'[email address of sender]:email:' \ |
|
999 | '(--from -f)'{-f,--from}'[email address of sender]:email:' \ | |
996 | '(--test -n)'{-n,--test}'[print messages that would be sent]' \ |
|
1000 | '(--test -n)'{-n,--test}'[print messages that would be sent]' \ | |
997 | '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \ |
|
1001 | '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \ | |
998 | '*--reply-to[email addresses replies should be sent to]:email:' \ |
|
1002 | '*--reply-to[email addresses replies should be sent to]:email:' \ | |
999 | '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \ |
|
1003 | '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \ | |
1000 | '--in-reply-to[message identifier to reply to]:msgid:' \ |
|
1004 | '--in-reply-to[message identifier to reply to]:msgid:' \ | |
1001 | '*--flag[flags to add in subject prefixes]:flag:' \ |
|
1005 | '*--flag[flags to add in subject prefixes]:flag:' \ | |
1002 | '*'{-t,--to}'[email addresses of recipients]:email:' \ |
|
1006 | '*'{-t,--to}'[email addresses of recipients]:email:' \ | |
1003 | ':revision:_hg_revrange' |
|
1007 | ':revision:_hg_revrange' | |
1004 | } |
|
1008 | } | |
1005 |
|
1009 | |||
1006 | _hg "$@" |
|
1010 | _hg "$@" |
General Comments 0
You need to be logged in to leave comments.
Login now