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