author | Brodie Rao <me+hg@dackz.net> |
Tue, 30 Jun 2009 17:58:17 -0400 | |
changeset 8982 | 9c0cecb71350 |
parent 8980 | 6d5dca8737b9 |
child 8983 | 0701044ad156 |
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 |
# |
|
8616
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
7 |
# If you do not want to install it globally, you can copy it somewhere |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
8 |
# else and add that directory to $fpath. This must be done before |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
9 |
# compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
10 |
# file could look like this: |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
11 |
# |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
12 |
# fpath=("$HOME/.zsh.d" $fpath) |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
13 |
# autoload -U compinit |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
14 |
# compinit |
704833724ff6
zsh-comp: explain how to use for non-global install
Martin Geisler <mg@lazybytes.net>
parents:
7510
diff
changeset
|
15 |
# |
8961
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
16 |
# Copyright (C) 2005, 2006 Steve Borho <steve@borho.org> |
8980
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
17 |
# Copyright (C) 2006-9 Brendan Cully <brendan@kublai.com> |
8961
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
18 |
# |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
19 |
# Permission is hereby granted, without written agreement and without |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
20 |
# licence or royalty fees, to use, copy, modify, and distribute this |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
21 |
# software and to distribute modified versions of this software for any |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
22 |
# purpose, provided that the above copyright notice and the following |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
23 |
# two paragraphs appear in all copies of this software. |
1362 | 24 |
# |
8961
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
25 |
# In no event shall the authors be liable to any party for direct, |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
26 |
# indirect, special, incidental, or consequential damages arising out of |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
27 |
# the use of this software and its documentation, even if the authors |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
28 |
# have been advised of the possibility of such damage. |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
29 |
# |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
30 |
# The authors specifically disclaim any warranties, including, but not |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
31 |
# limited to, the implied warranties of merchantability and fitness for |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
32 |
# a particular purpose. The software provided hereunder is on an "as |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
33 |
# is" basis, and the authors have no obligation to provide maintenance, |
c963d49ac7a1
Relicense zsh completion script under zsh license.
Brendan Cully <brendan@kublai.com>
parents:
8616
diff
changeset
|
34 |
# support, updates, enhancements, or modifications. |
1362 | 35 |
|
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
36 |
emulate -LR zsh |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
37 |
setopt extendedglob |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
38 |
|
1362 | 39 |
local curcontext="$curcontext" state line |
3537 | 40 |
typeset -A _hg_cmd_globals |
41 |
||
42 |
_hg() { |
|
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
43 |
local cmd _hg_root |
3537 | 44 |
integer i=2 |
45 |
_hg_cmd_globals=() |
|
46 |
||
47 |
while (( i < $#words )) |
|
48 |
do |
|
49 |
case "$words[$i]" in |
|
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
50 |
-R|--repository) |
3605
9d815b074dcb
zsh: perform ~ expansion on _hg_root
Brendan Cully <brendan@kublai.com>
parents:
3603
diff
changeset
|
51 |
eval _hg_root="$words[$i+1]" |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
52 |
_hg_cmd_globals+=("$words[$i]" "$_hg_root") |
3537 | 53 |
(( i += 2 )) |
54 |
continue |
|
55 |
;; |
|
56 |
-R*) |
|
57 |
_hg_cmd_globals+="$words[$i]" |
|
3605
9d815b074dcb
zsh: perform ~ expansion on _hg_root
Brendan Cully <brendan@kublai.com>
parents:
3603
diff
changeset
|
58 |
eval _hg_root="${words[$i]#-R}" |
3537 | 59 |
(( i++ )) |
60 |
continue |
|
61 |
;; |
|
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
62 |
--cwd|--config) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
63 |
# pass along arguments to hg completer |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
64 |
_hg_cmd_globals+=("$words[$i]" "$words[$i+1]") |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
65 |
(( i += 2 )) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
66 |
continue |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
67 |
;; |
3537 | 68 |
-*) |
69 |
# skip option |
|
70 |
(( i++ )) |
|
71 |
continue |
|
72 |
;; |
|
73 |
esac |
|
74 |
if [[ -z "$cmd" ]] |
|
75 |
then |
|
76 |
cmd="$words[$i]" |
|
77 |
words[$i]=() |
|
78 |
(( CURRENT-- )) |
|
79 |
fi |
|
80 |
(( i++ )) |
|
81 |
done |
|
82 |
||
83 |
if [[ -z "$cmd" ]] |
|
84 |
then |
|
85 |
_arguments -s -w : $_hg_global_opts \ |
|
86 |
':mercurial command:_hg_commands' |
|
87 |
return |
|
88 |
fi |
|
89 |
||
90 |
# resolve abbreviations and aliases |
|
91 |
if ! (( $+functions[_hg_cmd_${cmd}] )) |
|
92 |
then |
|
93 |
local cmdexp |
|
94 |
(( $#_hg_cmd_list )) || _hg_get_commands |
|
95 |
||
96 |
cmdexp=$_hg_cmd_list[(r)${cmd}*] |
|
97 |
if [[ $cmdexp == $_hg_cmd_list[(R)${cmd}*] ]] |
|
98 |
then |
|
99 |
# might be nice to rewrite the command line with the expansion |
|
100 |
cmd="$cmdexp" |
|
101 |
fi |
|
102 |
if [[ -n $_hg_alias_list[$cmd] ]] |
|
103 |
then |
|
104 |
cmd=$_hg_alias_list[$cmd] |
|
105 |
fi |
|
106 |
fi |
|
107 |
||
3600
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
108 |
curcontext="${curcontext%:*:*}:hg-${cmd}:" |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
109 |
|
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
110 |
zstyle -s ":completion:$curcontext:" cache-policy update_policy |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
111 |
|
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
112 |
if [[ -z "$update_policy" ]] |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
113 |
then |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
114 |
zstyle ":completion:$curcontext:" cache-policy _hg_cache_policy |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
115 |
fi |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
116 |
|
3537 | 117 |
if (( $+functions[_hg_cmd_${cmd}] )) |
118 |
then |
|
119 |
_hg_cmd_${cmd} |
|
3597
0d253ec988a6
zsh: complete unknown commands normally
Brendan Cully <brendan@kublai.com>
parents:
3587
diff
changeset
|
120 |
else |
0d253ec988a6
zsh: complete unknown commands normally
Brendan Cully <brendan@kublai.com>
parents:
3587
diff
changeset
|
121 |
# complete unknown commands normally |
0d253ec988a6
zsh: complete unknown commands normally
Brendan Cully <brendan@kublai.com>
parents:
3587
diff
changeset
|
122 |
_arguments -s -w : $_hg_global_opts \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
123 |
'*:files:_hg_files' |
3537 | 124 |
fi |
125 |
} |
|
3497
459e7cd943d4
zsh: complete according to the -R option if specified
Brendan Cully <brendan@kublai.com>
parents:
3496
diff
changeset
|
126 |
|
3600
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
127 |
_hg_cache_policy() { |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
128 |
typeset -a old |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
129 |
|
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
130 |
# cache for a minute |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
131 |
old=( "$1"(mm+10) ) |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
132 |
(( $#old )) && return 0 |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
133 |
|
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
134 |
return 1 |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
135 |
} |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
136 |
|
3537 | 137 |
_hg_get_commands() { |
138 |
typeset -ga _hg_cmd_list |
|
139 |
typeset -gA _hg_alias_list |
|
7510
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
140 |
local hline cmd cmdalias |
7466
05010666fb19
Update zsh completion for new help format
Brendan Cully <brendan@kublai.com>
parents:
7386
diff
changeset
|
141 |
|
7510
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
142 |
_call_program hg hg debugcomplete -v 2>/dev/null | while read -A hline |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
143 |
do |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
144 |
cmd=$hline[1] |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
145 |
_hg_cmd_list+=($cmd) |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
146 |
|
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
147 |
for cmdalias in $hline[2,-1] |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
148 |
do |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
149 |
_hg_cmd_list+=($cmdalias) |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
150 |
_hg_alias_list+=($cmdalias $cmd) |
21009e85ee78
Update zsh completion to use debugcomplete -v instead of parsing help
Brendan Cully <brendan@kublai.com>
parents:
7466
diff
changeset
|
151 |
done |
3537 | 152 |
done |
153 |
} |
|
154 |
||
155 |
_hg_commands() { |
|
156 |
(( $#_hg_cmd_list )) || _hg_get_commands |
|
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
157 |
_describe -t commands 'mercurial command' _hg_cmd_list |
3537 | 158 |
} |
159 |
||
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
160 |
_hg_revrange() { |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
161 |
compset -P 1 '*:' |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
162 |
_hg_tags "$@" |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
163 |
} |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
164 |
|
3537 | 165 |
_hg_tags() { |
166 |
typeset -a tags |
|
167 |
local tag rev |
|
168 |
||
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
169 |
_hg_cmd tags 2> /dev/null | while read tag |
3537 | 170 |
do |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
171 |
tags+=(${tag/ # [0-9]#:*}) |
3537 | 172 |
done |
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
173 |
(( $#tags )) && _describe -t tags 'tags' tags |
3537 | 174 |
} |
175 |
||
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
176 |
_hg_files() { |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
177 |
if [[ -n "$_hg_root" ]] |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
178 |
then |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
179 |
[[ -d "$_hg_root/.hg" ]] || return |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
180 |
case "$_hg_root" in |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
181 |
/*) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
182 |
_files -W $_hg_root |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
183 |
;; |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
184 |
*) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
185 |
_files -W $PWD/$_hg_root |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
186 |
;; |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
187 |
esac |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
188 |
else |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
189 |
_files |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
190 |
fi |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
191 |
} |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
192 |
|
3537 | 193 |
_hg_status() { |
3878
729f354f3f09
zsh: better fix for partial completions
Steve Borho <steve@borho.org>
parents:
3817
diff
changeset
|
194 |
[[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
3817
45a751d73080
zsh: fix completions with relative paths
Steve Borho <steve@borho.org>
parents:
3816
diff
changeset
|
195 |
status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"}) |
3537 | 196 |
} |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
197 |
|
3537 | 198 |
_hg_unknown() { |
199 |
typeset -a status_files |
|
200 |
_hg_status u |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
201 |
_wanted files expl 'unknown files' _multi_parts / status_files |
3537 | 202 |
} |
203 |
||
204 |
_hg_missing() { |
|
205 |
typeset -a status_files |
|
206 |
_hg_status d |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
207 |
_wanted files expl 'missing files' _multi_parts / status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
208 |
} |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
209 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
210 |
_hg_modified() { |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
211 |
typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
212 |
_hg_status m |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
213 |
_wanted files expl 'modified files' _multi_parts / status_files |
3537 | 214 |
} |
215 |
||
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
216 |
_hg_resolve() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
217 |
local rstate rpah |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
218 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
219 |
[[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
220 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
221 |
_hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
222 |
do |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
223 |
[[ $rstate == 'R' ]] && resolved_files+=($rpath) |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
224 |
[[ $rstate == 'U' ]] && unresolved_files+=($rpath) |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
225 |
done |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
226 |
} |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
227 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
228 |
_hg_resolved() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
229 |
typeset -a resolved_files unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
230 |
_hg_resolve |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
231 |
_wanted files expl 'resolved files' _multi_parts / resolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
232 |
} |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
233 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
234 |
_hg_unresolved() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
235 |
typeset -a resolved_files unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
236 |
_hg_resolve |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
237 |
_wanted files expl 'unresolved files' _multi_parts / unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
238 |
} |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
239 |
|
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
240 |
_hg_config() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
241 |
typeset -a items |
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
242 |
items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
243 |
(( $#items )) && _describe -t config 'config item' items |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
244 |
} |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
245 |
|
3537 | 246 |
_hg_addremove() { |
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
247 |
_alternative 'files:unknown files:_hg_unknown' \ |
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
248 |
'files:missing files:_hg_missing' |
3537 | 249 |
} |
250 |
||
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
251 |
_hg_ssh_urls() { |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
252 |
if [[ -prefix */ ]] |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
253 |
then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
254 |
if zstyle -T ":completion:${curcontext}:files" remote-access |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
255 |
then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
256 |
local host=${PREFIX%%/*} |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
257 |
typeset -a remdirs |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
258 |
compset -p $(( $#host + 1 )) |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
259 |
local rempath=${(M)PREFIX##*/} |
3602
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
260 |
local cacheid="hg:${host}-${rempath//\//_}" |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
261 |
cacheid=${cacheid%[-_]} |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
262 |
compset -P '*/' |
3600
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
263 |
if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
264 |
then |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
265 |
remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" 2> /dev/null)"}##*/}%/}) |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
266 |
_store_cache "$cacheid" remdirs |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
267 |
fi |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
268 |
_describe -t directories 'remote directory' remdirs -S/ |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
269 |
else |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
270 |
_message 'remote directory' |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
271 |
fi |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
272 |
else |
3602
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
273 |
if compset -P '*@' |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
274 |
then |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
275 |
_hosts -S/ |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
276 |
else |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
277 |
_alternative 'hosts:remote host name:_hosts -S/' \ |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
278 |
'users:user:_users -S@' |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
279 |
fi |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
280 |
fi |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
281 |
} |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
282 |
|
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
283 |
_hg_urls() { |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
284 |
if compset -P bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
285 |
then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
286 |
_files |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
287 |
elif compset -P ssh:// |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
288 |
then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
289 |
_hg_ssh_urls |
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
290 |
elif [[ -prefix *: ]] |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
291 |
then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
292 |
_urls |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
293 |
else |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
294 |
local expl |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
295 |
compset -S '[^:]*' |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
296 |
_wanted url-schemas expl 'URL schema' compadd -S '' - \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
297 |
http:// https:// ssh:// bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
298 |
fi |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
299 |
} |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
300 |
|
3537 | 301 |
_hg_paths() { |
302 |
typeset -a paths pnames |
|
303 |
_hg_cmd paths 2> /dev/null | while read -A pnames |
|
304 |
do |
|
305 |
paths+=($pnames[1]) |
|
306 |
done |
|
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
307 |
(( $#paths )) && _describe -t path-aliases 'repository alias' paths |
3537 | 308 |
} |
309 |
||
310 |
_hg_remote() { |
|
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
311 |
_alternative 'path-aliases:repository alias:_hg_paths' \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
312 |
'directories:directory:_files -/' \ |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
313 |
'urls:URL:_hg_urls' |
3537 | 314 |
} |
315 |
||
3601
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
316 |
_hg_clone_dest() { |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
317 |
_alternative 'directories:directory:_files -/' \ |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
318 |
'urls:URL:_hg_urls' |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
319 |
} |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
320 |
|
3537 | 321 |
# Common options |
322 |
_hg_global_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
323 |
'(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
3537 | 324 |
'--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
|
325 |
'(--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
|
326 |
'(--verbose -v)'{-v,--verbose}'[enable additional output]' |
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
327 |
'*--config[set/override config option]:defined config items:_hg_config' |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
328 |
'(--quiet -q)'{-q,--quiet}'[suppress output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
329 |
'(--help -h)'{-h,--help}'[display help and exit]' |
3537 | 330 |
'--debug[debug mode]' |
331 |
'--debugger[start debugger]' |
|
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
332 |
'--encoding[set the charset encoding (default: UTF8)]' |
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
333 |
'--encodingmode[set the charset encoding mode (default: strict)]' |
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
334 |
'--lsprof[print improved command execution profile]' |
3537 | 335 |
'--traceback[print traceback on exception]' |
336 |
'--time[time how long the command takes]' |
|
337 |
'--profile[profile]' |
|
338 |
'--version[output version information and exit]' |
|
339 |
) |
|
340 |
||
341 |
_hg_pat_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
342 |
'*'{-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
|
343 |
'*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
3537 | 344 |
|
345 |
_hg_diff_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
346 |
'(--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
|
347 |
'(--git -g)'{-g,--git}'[use git extended diff format]' |
3537 | 348 |
"--nodates[don't include dates in diff headers]") |
349 |
||
350 |
_hg_dryrun_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
351 |
'(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
3537 | 352 |
|
353 |
_hg_style_opts=( |
|
354 |
'--style[display using template map file]:' |
|
355 |
'--template[display with template]:') |
|
356 |
||
357 |
_hg_commit_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
358 |
'(-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
|
359 |
'(-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
|
360 |
'(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') |
3537 | 361 |
|
362 |
_hg_remote_opts=( |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
363 |
'(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
3537 | 364 |
'--remotecmd[specify hg command to run on the remote side]:') |
365 |
||
366 |
_hg_cmd() { |
|
8982
9c0cecb71350
zsh completion: disable defaults and verbose output when completing
Brodie Rao <me+hg@dackz.net>
parents:
8980
diff
changeset
|
367 |
_call_program hg hg --config ui.verbose=0 --config defaults."$1"= \ |
9c0cecb71350
zsh completion: disable defaults and verbose output when completing
Brodie Rao <me+hg@dackz.net>
parents:
8980
diff
changeset
|
368 |
"$_hg_cmd_globals[@]" "$@" |
3537 | 369 |
} |
370 |
||
371 |
_hg_cmd_add() { |
|
372 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
|
373 |
'*:unknown files:_hg_unknown' |
|
374 |
} |
|
375 |
||
376 |
_hg_cmd_addremove() { |
|
377 |
_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
|
378 |
'(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ |
3537 | 379 |
'*:unknown or missing files:_hg_addremove' |
380 |
} |
|
381 |
||
382 |
_hg_cmd_annotate() { |
|
383 |
_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
|
384 |
'(--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
|
385 |
'(--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
|
386 |
'(--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
|
387 |
'(--user -u)'{-u,--user}'[list the author]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
388 |
'(--date -d)'{-d,--date}'[list the date]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
389 |
'(--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
|
390 |
'(--changeset -c)'{-c,--changeset}'[list the changeset]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
391 |
'*:files:_hg_files' |
3537 | 392 |
} |
393 |
||
394 |
_hg_cmd_archive() { |
|
395 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
396 |
'--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
|
397 |
'(--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
|
398 |
'(--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
|
399 |
'(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ |
3537 | 400 |
'*:destination:_files' |
401 |
} |
|
402 |
||
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
403 |
_hg_cmd_backout() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
404 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
405 |
'--merge[merge with old dirstate parent after backout]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
406 |
'(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
407 |
'--parent[parent to choose when backing out merge]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
408 |
'(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
409 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
410 |
'(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
411 |
'(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
412 |
} |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
413 |
|
3537 | 414 |
_hg_cmd_bundle() { |
415 |
_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
|
416 |
'(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
3537 | 417 |
'(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \ |
418 |
':output file:_files' \ |
|
419 |
':destination repository:_files -/' |
|
420 |
} |
|
421 |
||
422 |
_hg_cmd_cat() { |
|
423 |
_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
|
424 |
'(--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
|
425 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
426 |
'*:file:_hg_files' |
3537 | 427 |
} |
428 |
||
429 |
_hg_cmd_clone() { |
|
430 |
_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
|
431 |
'(--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
|
432 |
'(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ |
3537 | 433 |
'--uncompressed[use uncompressed transfer (fast over LAN)]' \ |
434 |
':source repository:_hg_remote' \ |
|
3601
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
435 |
':destination:_hg_clone_dest' |
3537 | 436 |
} |
437 |
||
438 |
_hg_cmd_commit() { |
|
439 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
3666
adbf440a81e0
zsh: typo in commit completion
Brendan Cully <brendan@kublai.com>
parents:
3605
diff
changeset
|
440 |
'(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
441 |
'(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
4441
2d3379c598c1
Fix issue 563: error in _hg_commit in the contrib/zsh_completion script.
Henri Precheur <henry@precheur.org>
parents:
3878
diff
changeset
|
442 |
'(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
443 |
'(--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
|
444 |
'(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
445 |
'*:file:_hg_files' |
3537 | 446 |
} |
447 |
||
448 |
_hg_cmd_copy() { |
|
449 |
_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
|
450 |
'(--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
|
451 |
'(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
452 |
'*:file:_hg_files' |
3537 | 453 |
} |
454 |
||
455 |
_hg_cmd_diff() { |
|
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
456 |
typeset -A opt_args |
3537 | 457 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
458 |
'*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
459 |
'(--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
|
460 |
'(--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
|
461 |
'(--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
|
462 |
'(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \ |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
463 |
'*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
464 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
465 |
if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
466 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
467 |
if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
468 |
then |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
469 |
_hg_files |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
470 |
else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
471 |
_hg_modified |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
472 |
fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
473 |
fi |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
474 |
} |
1362 | 475 |
|
3537 | 476 |
_hg_cmd_export() { |
477 |
_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
|
478 |
'(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
3537 | 479 |
'--switch-parent[diff against the second parent]' \ |
480 |
'*:revision:_hg_tags' |
|
481 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
482 |
|
3537 | 483 |
_hg_cmd_grep() { |
484 |
_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
|
485 |
'(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ |
3537 | 486 |
'--all[print all revisions with matches]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
487 |
'(--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
|
488 |
'(--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
|
489 |
'(--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
|
490 |
'(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
491 |
'*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
492 |
'(--user -u)'{-u,--user}'[print user who committed change]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
493 |
'1:search pattern:' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
494 |
'*:files:_hg_files' |
3537 | 495 |
} |
1362 | 496 |
|
3537 | 497 |
_hg_cmd_heads() { |
498 |
_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
|
499 |
'(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags' |
3537 | 500 |
} |
501 |
||
502 |
_hg_cmd_help() { |
|
503 |
_arguments -s -w : $_hg_global_opts \ |
|
504 |
'*:mercurial command:_hg_commands' |
|
505 |
} |
|
1362 | 506 |
|
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
507 |
_hg_cmd_identify() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
508 |
_arguments -s -w : $_hg_global_opts \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
509 |
'(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
510 |
'(--num -n)'{-n+,--num}'[show local revision number]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
511 |
'(--id -i)'{-i+,--id}'[show global revision id]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
512 |
'(--branch -b)'{-b+,--branch}'[show branch]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
513 |
'(--tags -t)'{-t+,--tags}'[show tags]' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
514 |
} |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
515 |
|
3537 | 516 |
_hg_cmd_import() { |
517 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
518 |
'(--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
|
519 |
'(--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
|
520 |
'(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ |
3537 | 521 |
'*:patch:_files' |
522 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
523 |
|
3537 | 524 |
_hg_cmd_incoming() { |
525 |
_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
|
526 |
'(--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
|
527 |
'(--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
|
528 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
529 |
'(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
530 |
'(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 531 |
'--bundle[file to store the bundles into]:bundle file:_files' \ |
532 |
':source:_hg_remote' |
|
533 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
534 |
|
3537 | 535 |
_hg_cmd_init() { |
536 |
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
|
537 |
':dir:_files -/' |
|
538 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
539 |
|
3537 | 540 |
_hg_cmd_locate() { |
541 |
_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
|
542 |
'(--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
|
543 |
'(--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
|
544 |
'(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
545 |
'*:search pattern:_hg_files' |
3537 | 546 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
547 |
|
3537 | 548 |
_hg_cmd_log() { |
549 |
_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
|
550 |
'(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ |
3537 | 551 |
'(-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
|
552 |
'(--copies -C)'{-C,--copies}'[show copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
553 |
'(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
554 |
'(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
555 |
'*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
556 |
'(--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
|
557 |
'(--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
|
558 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
559 |
'(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_tags' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
560 |
'*:files:_hg_files' |
3537 | 561 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
562 |
|
3537 | 563 |
_hg_cmd_manifest() { |
564 |
_arguments -s -w : $_hg_global_opts \ |
|
565 |
':revision:_hg_tags' |
|
566 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
567 |
|
3537 | 568 |
_hg_cmd_outgoing() { |
569 |
_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
|
570 |
'(--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
|
571 |
'(--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
|
572 |
'(--patch -p)'{-p,--patch}'[show patch]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
573 |
'(--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
|
574 |
'(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 575 |
':destination:_hg_remote' |
576 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
577 |
|
3537 | 578 |
_hg_cmd_parents() { |
579 |
_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
|
580 |
'(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
581 |
':last modified file:_hg_files' |
3537 | 582 |
} |
583 |
||
584 |
_hg_cmd_paths() { |
|
585 |
_arguments -s -w : $_hg_global_opts \ |
|
586 |
':path:_hg_paths' |
|
587 |
} |
|
588 |
||
589 |
_hg_cmd_pull() { |
|
590 |
_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
|
591 |
'(--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
|
592 |
'(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
593 |
'(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ |
3537 | 594 |
':source:_hg_remote' |
595 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
596 |
|
3537 | 597 |
_hg_cmd_push() { |
598 |
_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
|
599 |
'(--force -f)'{-f,--force}'[force push]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
600 |
'(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ |
3537 | 601 |
':destination:_hg_remote' |
602 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
603 |
|
3537 | 604 |
_hg_cmd_remove() { |
605 |
_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
|
606 |
'(--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
|
607 |
'(--force -f)'{-f,--force}'[remove file even if modified]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
608 |
'*:file:_hg_files' |
3537 | 609 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
610 |
|
3537 | 611 |
_hg_cmd_rename() { |
612 |
_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
|
613 |
'(--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
|
614 |
'(--force -f)'{-f,--force}'[forcibly copy over an existing managed file]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
615 |
'*:file:_hg_files' |
3537 | 616 |
} |
1362 | 617 |
|
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
618 |
_hg_cmd_resolve() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
619 |
local context state line |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
620 |
typeset -A opt_args |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
621 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
622 |
_arguments -s -w : $_hg_global_opts \ |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
623 |
'(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \ |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
624 |
'(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \ |
7386
86bfd65532ac
zsh: make resolve with no options only complete unresolved files
Brendan Cully <brendan@kublai.com>
parents:
7384
diff
changeset
|
625 |
'(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \ |
86bfd65532ac
zsh: make resolve with no options only complete unresolved files
Brendan Cully <brendan@kublai.com>
parents:
7384
diff
changeset
|
626 |
'*:file:_hg_unresolved' |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
627 |
|
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
628 |
if [[ $state == 'resolve_files' ]] |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
629 |
then |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
630 |
_alternative 'files:resolved files:_hg_resolved' \ |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
631 |
'files:unresolved files:_hg_unresolved' |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
632 |
fi |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
633 |
} |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
634 |
|
3537 | 635 |
_hg_cmd_revert() { |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
636 |
local context state line |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
637 |
typeset -A opt_args |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
638 |
|
3537 | 639 |
_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
|
640 |
'(--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
|
641 |
'(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_tags' \ |
3537 | 642 |
'--no-backup[do not save backup copies of files]' \ |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
643 |
'*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
644 |
|
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
645 |
if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
646 |
then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
647 |
if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
648 |
then |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
649 |
_hg_files |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
650 |
else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
651 |
typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
652 |
_hg_status mard |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
653 |
_wanted files expl 'modified, added, removed or deleted file' _multi_parts / status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
654 |
fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
655 |
fi |
3537 | 656 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
657 |
|
3537 | 658 |
_hg_cmd_serve() { |
659 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
660 |
'(--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
|
661 |
'(--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
|
662 |
'(--daemon -d)'{-d,--daemon}'[run server in background]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
663 |
'(--port -p)'{-p+,--port}'[listen port]:listen port:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
664 |
'(--address -a)'{-a+,--address}'[interface address]:interface address:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
665 |
'(--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
|
666 |
'(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ |
3537 | 667 |
'--style[web template style]:style' \ |
668 |
'--stdio[for remote clients]' \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
669 |
'(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' |
3537 | 670 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
671 |
|
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
672 |
_hg_cmd_showconfig() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
673 |
_arguments -s -w : $_hg_global_opts \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
674 |
'(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
675 |
':config item:_hg_config' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
676 |
} |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
677 |
|
3537 | 678 |
_hg_cmd_status() { |
679 |
_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
|
680 |
'(--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
|
681 |
'(--modified -m)'{-m,--modified}'[show only modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
682 |
'(--added -a)'{-a,--added}'[show only added files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
683 |
'(--removed -r)'{-r,--removed}'[show only removed files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
684 |
'(--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
|
685 |
'(--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
|
686 |
'(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
687 |
'(--ignored -i)'{-i,--ignored}'[show ignored files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
688 |
'(--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
|
689 |
'(--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
|
690 |
'(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
3537 | 691 |
'--rev[show difference from revision]:revision:_hg_tags' \ |
692 |
'*:files:_files' |
|
693 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
694 |
|
3537 | 695 |
_hg_cmd_tag() { |
696 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
697 |
'(--local -l)'{-l,--local}'[make the tag local]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
698 |
'(--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
|
699 |
'(--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
|
700 |
'(--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
|
701 |
'(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_tags' \ |
3537 | 702 |
':tag name:' |
703 |
} |
|
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
704 |
|
3537 | 705 |
_hg_cmd_tip() { |
706 |
_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
|
707 |
'(--patch -p)'{-p,--patch}'[show patch]' |
3537 | 708 |
} |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
709 |
|
3537 | 710 |
_hg_cmd_unbundle() { |
711 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
712 |
'(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ |
3537 | 713 |
':files:_files' |
714 |
} |
|
1362 | 715 |
|
3537 | 716 |
_hg_cmd_update() { |
717 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
718 |
'(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
719 |
'(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
3537 | 720 |
':revision:_hg_tags' |
721 |
} |
|
1362 | 722 |
|
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
723 |
# bisect extension |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
724 |
_hg_cmd_bisect() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
725 |
_arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
726 |
} |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
727 |
|
3537 | 728 |
# HGK |
729 |
_hg_cmd_view() { |
|
730 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
731 |
'(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3537 | 732 |
':revision range:_hg_tags' |
733 |
} |
|
1362 | 734 |
|
3537 | 735 |
# MQ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
736 |
_hg_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
737 |
typeset -a patches |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
738 |
patches=(${(f)"$(_hg_cmd qseries 2>/dev/null)"}) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
739 |
(( $#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
|
740 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
741 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
742 |
_hg_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
743 |
typeset -a patches |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
744 |
patches=(${(f)"$(_hg_cmd qapplied 2>/dev/null)"}) |
3549
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
745 |
if (( $#patches )) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
746 |
then |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
747 |
patches+=(qbase qtip) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
748 |
_describe -t hg-applied-patches 'applied patches' patches |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
749 |
fi |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
750 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
751 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
752 |
_hg_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
753 |
typeset -a patches |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
754 |
patches=(${(f)"$(_hg_cmd qunapplied 2>/dev/null)"}) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
755 |
(( $#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
|
756 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
757 |
|
8980
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
758 |
# unapplied, including guarded patches |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
759 |
_hg_qdeletable() { |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
760 |
typeset -a unapplied |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
761 |
unapplied=(${(f)"$(_hg_cmd qseries 2>/dev/null)"}) |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
762 |
for p in $(_hg_cmd qapplied 2>/dev/null) |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
763 |
do |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
764 |
unapplied=(${unapplied:#$p}) |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
765 |
done |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
766 |
|
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
767 |
(( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
768 |
} |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
769 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
770 |
_hg_qguards() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
771 |
typeset -a guards |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
772 |
local guard |
3543
fe9c1e886b5e
zsh: complete qguard with +/- guard prefixes
Brendan Cully <brendan@kublai.com>
parents:
3541
diff
changeset
|
773 |
compset -P "+|-" |
3559
35b99f076d02
zsh: suppress mq completion error messages outside of repository
Brendan Cully <brendan@kublai.com>
parents:
3558
diff
changeset
|
774 |
_hg_cmd qselect -s 2>/dev/null | while read guard |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
775 |
do |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
776 |
guards+=(${guard#(+|-)}) |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
777 |
done |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
778 |
(( $#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
|
779 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
780 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
781 |
_hg_qseries_opts=( |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
782 |
'(--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
|
783 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
784 |
_hg_cmd_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
785 |
_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
|
786 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
787 |
|
3537 | 788 |
_hg_cmd_qdelete() { |
789 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
790 |
'(--keep -k)'{-k,--keep}'[keep patch file]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
791 |
'*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ |
8980
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
792 |
'*:unapplied patch:_hg_qdeletable' |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
793 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
794 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
795 |
_hg_cmd_qdiff() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
796 |
_arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
797 |
'*:pattern:_hg_files' |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
798 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
799 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
800 |
_hg_cmd_qfold() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
801 |
_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
|
802 |
'(--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
|
803 |
'*:unapplied patch:_hg_qunapplied' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
804 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
805 |
|
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
806 |
_hg_cmd_qgoto() { |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
807 |
_arguments -s -w : $_hg_global_opts \ |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
808 |
'(--force -f)'{-f,--force}'[overwrite any local changes]' \ |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
809 |
':patch:_hg_qseries' |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
810 |
} |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
811 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
812 |
_hg_cmd_qguard() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
813 |
_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
|
814 |
'(--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
|
815 |
'(--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
|
816 |
':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
817 |
'*:guards:_hg_qguards' |
3537 | 818 |
} |
1362 | 819 |
|
3537 | 820 |
_hg_cmd_qheader() { |
821 |
_arguments -s -w : $_hg_global_opts \ |
|
822 |
':patch:_hg_qseries' |
|
823 |
} |
|
1362 | 824 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
825 |
_hg_cmd_qimport() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
826 |
_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
|
827 |
'(--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
|
828 |
'(--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
|
829 |
'(--force -f)'{-f,--force}'[overwrite existing files]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
830 |
'*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
831 |
'*:patch:_files' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
832 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
833 |
|
3537 | 834 |
_hg_cmd_qnew() { |
835 |
_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
|
836 |
'(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
3537 | 837 |
':patch:' |
838 |
} |
|
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
839 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
840 |
_hg_cmd_qnext() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
841 |
_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
|
842 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
843 |
|
3537 | 844 |
_hg_cmd_qpop() { |
845 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
846 |
'(--all -a :)'{-a,--all}'[pop all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
847 |
'(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
848 |
'(--force -f)'{-f,--force}'[forget any local changes]' \ |
3537 | 849 |
':patch:_hg_qapplied' |
850 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
851 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
852 |
_hg_cmd_qprev() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
853 |
_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
|
854 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
855 |
|
3537 | 856 |
_hg_cmd_qpush() { |
857 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
858 |
'(--all -a :)'{-a,--all}'[apply all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
859 |
'(--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
|
860 |
'(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
861 |
'(--name -n)'{-n+,--name}'[merge queue name]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
862 |
'(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
3537 | 863 |
':patch:_hg_qunapplied' |
864 |
} |
|
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
865 |
|
3537 | 866 |
_hg_cmd_qrefresh() { |
867 |
_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
|
868 |
'(--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
|
869 |
'(--short -s)'{-s,--short}'[short refresh]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
870 |
'*:files:_hg_files' |
3537 | 871 |
} |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
872 |
|
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
873 |
_hg_cmd_qrename() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
874 |
_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
|
875 |
':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
876 |
':destination:' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
877 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
878 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
879 |
_hg_cmd_qselect() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
880 |
_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
|
881 |
'(--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
|
882 |
'(--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
|
883 |
'--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
|
884 |
'--reapply[pop and reapply patches]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
885 |
'*:guards:_hg_qguards' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
886 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
887 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
888 |
_hg_cmd_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
889 |
_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
|
890 |
'(--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
|
891 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
892 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
893 |
_hg_cmd_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
894 |
_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
|
895 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
896 |
|
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
897 |
_hg_cmd_qtop() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
898 |
_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
|
899 |
} |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
900 |
|
3537 | 901 |
_hg_cmd_strip() { |
902 |
_arguments -s -w : $_hg_global_opts \ |
|
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
903 |
'(--force -f)'{-f,--force}'[force multi-head removal]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
904 |
'(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
905 |
'(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
3537 | 906 |
':revision:_hg_tags' |
907 |
} |
|
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
908 |
|
3537 | 909 |
_hg "$@" |