Mercurial > hg
annotate contrib/zsh_completion @ 17399:dbff625679a1
zsh completion: add subrepos options for all supporting commands
author | Nikolaj Sjujskij <sterkrig@myopera.com> |
---|---|
date | Thu, 16 Aug 2012 19:03:01 +0400 |
parents | b290d3b1c1b8 |
children | 3ae4da1c362a |
rev | line source |
---|---|
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> |
12168
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
17 # Copyright (C) 2006-10 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 |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
142 _call_program hg hg debugcomplete -v | while read -A hline |
7510
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 '*:' |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
162 _hg_labels "$@" |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
163 } |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
164 |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
165 _hg_labels() { |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
166 _hg_tags "$@" |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
167 _hg_bookmarks "$@" |
15100
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
168 _hg_branches "$@" |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
169 } |
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
170 |
3537 | 171 _hg_tags() { |
172 typeset -a tags | |
173 local tag rev | |
174 | |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
175 _hg_cmd tags | while read tag |
3537 | 176 do |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
177 tags+=(${tag/ # [0-9]#:*}) |
3537 | 178 done |
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
179 (( $#tags )) && _describe -t tags 'tags' tags |
3537 | 180 } |
181 | |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
182 _hg_bookmarks() { |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
183 typeset -a bookmark bookmarks |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
184 |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
185 _hg_cmd bookmarks | while read -A bookmark |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
186 do |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
187 if test -z ${bookmark[-1]:#[0-9]*} |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
188 then |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
189 bookmarks+=($bookmark[-2]) |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
190 fi |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
191 done |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
192 (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
193 } |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
194 |
15100
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
195 _hg_branches() { |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
196 typeset -a branches |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
197 local branch |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
198 |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
199 _hg_cmd branches | while read branch |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
200 do |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
201 branches+=(${branch/ # [0-9]#:*}) |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
202 done |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
203 (( $#branches )) && _describe -t branches 'branches' branches |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
204 } |
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
205 |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
206 # likely merge candidates |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
207 _hg_mergerevs() { |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
208 typeset -a heads |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
209 local myrev |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
210 |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
211 heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
212 # exclude own revision |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
213 myrev=$(_hg_cmd log -r . --template '{rev}\\n') |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
214 heads=(${heads:#$myrev}) |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
215 |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
216 (( $#heads )) && _describe -t heads 'heads' heads |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
217 } |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
218 |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
219 _hg_files() { |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
220 if [[ -n "$_hg_root" ]] |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
221 then |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
222 [[ -d "$_hg_root/.hg" ]] || return |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
223 case "$_hg_root" in |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
224 /*) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
225 _files -W $_hg_root |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
226 ;; |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
227 *) |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
228 _files -W $PWD/$_hg_root |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
229 ;; |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
230 esac |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
231 else |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
232 _files |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
233 fi |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
234 } |
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
235 |
3537 | 236 _hg_status() { |
3878
729f354f3f09
zsh: better fix for partial completions
Steve Borho <steve@borho.org>
parents:
3817
diff
changeset
|
237 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
238 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) |
3537 | 239 } |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
240 |
3537 | 241 _hg_unknown() { |
242 typeset -a status_files | |
243 _hg_status u | |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
244 _wanted files expl 'unknown files' _multi_parts / status_files |
3537 | 245 } |
246 | |
247 _hg_missing() { | |
248 typeset -a status_files | |
249 _hg_status d | |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
250 _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
|
251 } |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
252 |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
253 _hg_modified() { |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
254 typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
255 _hg_status m |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
256 _wanted files expl 'modified files' _multi_parts / status_files |
3537 | 257 } |
258 | |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
259 _hg_resolve() { |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
260 local rstate rpath |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
261 |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
262 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
263 |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
264 _hg_cmd resolve -l ./$PREFIX | while read rstate rpath |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
265 do |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
266 [[ $rstate == 'R' ]] && resolved_files+=($rpath) |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
267 [[ $rstate == 'U' ]] && unresolved_files+=($rpath) |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
268 done |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
269 } |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
270 |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
271 _hg_resolved() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
272 typeset -a resolved_files unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
273 _hg_resolve |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
274 _wanted files expl 'resolved files' _multi_parts / resolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
275 } |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
276 |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
277 _hg_unresolved() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
278 typeset -a resolved_files unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
279 _hg_resolve |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
280 _wanted files expl 'unresolved files' _multi_parts / unresolved_files |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
281 } |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
282 |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
283 _hg_config() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
284 typeset -a items |
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
285 items=(${${(%f)"$(_call_program hg hg showconfig)"}%%\=*}) |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
286 (( $#items )) && _describe -t config 'config item' items |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
287 } |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
288 |
3537 | 289 _hg_addremove() { |
3548
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
290 _alternative 'files:unknown files:_hg_unknown' \ |
811e6c95485c
zsh: use standard tags where possible
Brendan Cully <brendan@kublai.com>
parents:
3543
diff
changeset
|
291 'files:missing files:_hg_missing' |
3537 | 292 } |
293 | |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
294 _hg_ssh_urls() { |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
295 if [[ -prefix */ ]] |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
296 then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
297 if zstyle -T ":completion:${curcontext}:files" remote-access |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
298 then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
299 local host=${PREFIX%%/*} |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
300 typeset -a remdirs |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
301 compset -p $(( $#host + 1 )) |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
302 local rempath=${(M)PREFIX##*/} |
3602
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
303 local cacheid="hg:${host}-${rempath//\//_}" |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
304 cacheid=${cacheid%[-_]} |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
305 compset -P '*/' |
3600
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
306 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
307 then |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
308 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) |
3600
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
309 _store_cache "$cacheid" remdirs |
932dadd2e614
zsh: add optional remote directory cache
Brendan Cully <brendan@kublai.com>
parents:
3598
diff
changeset
|
310 fi |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
311 _describe -t directories 'remote directory' remdirs -S/ |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
312 else |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
313 _message 'remote directory' |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
314 fi |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
315 else |
3602
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
316 if compset -P '*@' |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
317 then |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
318 _hosts -S/ |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
319 else |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
320 _alternative 'hosts:remote host name:_hosts -S/' \ |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
321 'users:user:_users -S@' |
ec221317e018
zsh: complete users in ssh URLS
Brendan Cully <brendan@kublai.com>
parents:
3601
diff
changeset
|
322 fi |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
323 fi |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
324 } |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
325 |
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
326 _hg_urls() { |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
327 if compset -P bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
328 then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
329 _files |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
330 elif compset -P ssh:// |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
331 then |
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
332 _hg_ssh_urls |
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
333 elif [[ -prefix *: ]] |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
334 then |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
335 _urls |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
336 else |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
337 local expl |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
338 compset -S '[^:]*' |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
339 _wanted url-schemas expl 'URL schema' compadd -S '' - \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
340 http:// https:// ssh:// bundle:// |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
341 fi |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
342 } |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
343 |
3537 | 344 _hg_paths() { |
345 typeset -a paths pnames | |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
346 _hg_cmd paths | while read -A pnames |
3537 | 347 do |
348 paths+=($pnames[1]) | |
349 done | |
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
350 (( $#paths )) && _describe -t path-aliases 'repository alias' paths |
3537 | 351 } |
352 | |
353 _hg_remote() { | |
3560
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
354 _alternative 'path-aliases:repository alias:_hg_paths' \ |
6106236bc4eb
zsh: support remote URLs
Brendan Cully <brendan@kublai.com>
parents:
3559
diff
changeset
|
355 'directories:directory:_files -/' \ |
3598
27121416f9a8
zsh: complete SSH directories
Brendan Cully <brendan@kublai.com>
parents:
3597
diff
changeset
|
356 'urls:URL:_hg_urls' |
3537 | 357 } |
358 | |
3601
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
359 _hg_clone_dest() { |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
360 _alternative 'directories:directory:_files -/' \ |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
361 'urls:URL:_hg_urls' |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
362 } |
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
363 |
17396
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
364 _hg_add_help_topics=( |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
365 config dates diffs environment extensions filesets glossary hgignore hgweb |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
366 merge-tools multirevs obsolescence patterns phases revisions revsets |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
367 subrepos templating urls |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
368 ) |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
369 |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
370 _hg_help_topics() { |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
371 local topics |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
372 (( $#_hg_cmd_list )) || _hg_get_commands |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
373 topics=($_hg_cmd_list $_hg_add_help_topics) |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
374 _describe -t help_topics 'help topics' topics |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
375 } |
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
376 |
3537 | 377 # Common options |
378 _hg_global_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
379 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
3537 | 380 '--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
|
381 '(--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
|
382 '(--verbose -v)'{-v,--verbose}'[enable additional output]' |
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
383 '*--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
|
384 '(--quiet -q)'{-q,--quiet}'[suppress output]' |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
385 '(--help -h)'{-h,--help}'[display help and exit]' |
3537 | 386 '--debug[debug mode]' |
387 '--debugger[start debugger]' | |
13562
7c6e9b57a4cc
zsh completion: remove computed default values from help texts
Martin Geisler <mg@aragost.com>
parents:
13511
diff
changeset
|
388 '--encoding[set the charset encoding]' |
7c6e9b57a4cc
zsh completion: remove computed default values from help texts
Martin Geisler <mg@aragost.com>
parents:
13511
diff
changeset
|
389 '--encodingmode[set the charset encoding mode]' |
6804
694223a29ad4
Added missing --config global option to zsh_completion.
byron@base2.cc
parents:
5868
diff
changeset
|
390 '--lsprof[print improved command execution profile]' |
3537 | 391 '--traceback[print traceback on exception]' |
392 '--time[time how long the command takes]' | |
393 '--profile[profile]' | |
394 '--version[output version information and exit]' | |
395 ) | |
396 | |
397 _hg_pat_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
398 '*'{-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
|
399 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
3537 | 400 |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
401 _hg_clone_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
402 $_hg_remote_opts |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
403 '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
404 '--pull[use pull protocol to copy metadata]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
405 '--uncompressed[use uncompressed transfer (fast over LAN)]') |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
406 |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
407 _hg_date_user_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
408 '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
409 '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
410 '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
411 '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:') |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
412 |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
413 _hg_gitlike_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
414 '(--git -g)'{-g,--git}'[use git extended diff format]') |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
415 |
3537 | 416 _hg_diff_opts=( |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
417 $_hg_gitlike_opts |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
418 '(--text -a)'{-a,--text}'[treat all files as text]' |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
419 '--nodates[omit dates from diff headers]') |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
420 |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
421 _hg_mergetool_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
422 '(--tool -t)'{-t+,--tool}'[specify merge tool]:tool:') |
3537 | 423 |
424 _hg_dryrun_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
425 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
3537 | 426 |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
427 _hg_ignore_space_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
428 '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
429 '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
430 '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]') |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
431 |
3537 | 432 _hg_style_opts=( |
433 '--style[display using template map file]:' | |
434 '--template[display with template]:') | |
435 | |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
436 _hg_log_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
437 $_hg_global_opts $_hg_style_opts $_hg_gitlike_opts |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
438 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
439 '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
440 '(--patch -p)'{-p,--patch}'[show patch]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
441 '--stat[output diffstat-style summary of changes]' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
442 ) |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
443 |
3537 | 444 _hg_commit_opts=( |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
445 '(-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
|
446 '(-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
|
447 '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files') |
3537 | 448 |
449 _hg_remote_opts=( | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
450 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
3537 | 451 '--remotecmd[specify hg command to run on the remote side]:') |
452 | |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
453 _hg_branch_bmark_opts=( |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
454 '(--bookmark -B)'{-B+,--bookmark}'[specify bookmark(s)]:bookmark:_hg_bookmarks' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
455 '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches' |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
456 ) |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
457 |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
458 _hg_subrepos_opts=( |
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
459 '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]') |
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
460 |
3537 | 461 _hg_cmd() { |
11646
91af149b5cd7
bash/zsh completion: use HGPLAIN when invoking hg (issue2297)
Brodie Rao <brodie@bitheap.org>
parents:
10456
diff
changeset
|
462 _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null |
3537 | 463 } |
464 | |
465 _hg_cmd_add() { | |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
466 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts $_hg_subrepos_opts \ |
3537 | 467 '*:unknown files:_hg_unknown' |
468 } | |
469 | |
470 _hg_cmd_addremove() { | |
471 _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
|
472 '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \ |
3537 | 473 '*:unknown or missing files:_hg_addremove' |
474 } | |
475 | |
476 _hg_cmd_annotate() { | |
477 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
478 '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_labels' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
479 '(--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
|
480 '(--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
|
481 '(--user -u)'{-u,--user}'[list the author]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
482 '(--date -d)'{-d,--date}'[list the date]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
483 '(--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
|
484 '(--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
|
485 '*:files:_hg_files' |
3537 | 486 } |
487 | |
488 _hg_cmd_archive() { | |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
489 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ |
3537 | 490 '--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
|
491 '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
492 '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
493 '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \ |
3537 | 494 '*:destination:_files' |
495 } | |
496 | |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
497 _hg_cmd_backout() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
498 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
499 '--merge[merge with old dirstate parent after backout]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
500 '(--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
|
501 '--parent[parent to choose when backing out merge]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
502 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
503 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
504 '(--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
|
505 '(--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
|
506 } |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
507 |
8986
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
508 _hg_cmd_bisect() { |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
509 _arguments -s -w : $_hg_global_opts \ |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
510 '(-)'{-r,--reset}'[reset bisect state]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
511 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
512 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \ |
8986
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
513 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
514 '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
515 '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
516 } |
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
517 |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
518 _hg_cmd_bookmarks() { |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
519 _arguments -s -w : $_hg_global_opts \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
520 '(--force -f)'{-f,--force}'[force]' \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
521 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_labels' \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
522 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
523 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
524 ':bookmark:_hg_bookmarks' |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
525 } |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
526 |
8985
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
527 _hg_cmd_branch() { |
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
528 _arguments -s -w : $_hg_global_opts \ |
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
529 '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ |
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
530 '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' |
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
531 } |
a04c1ab282fe
zsh completion: add hg branch
Brendan Cully <brendan@kublai.com>
parents:
8984
diff
changeset
|
532 |
8984
67389a94825a
zsh completion: add hg branches
Brendan Cully <brendan@kublai.com>
parents:
8983
diff
changeset
|
533 _hg_cmd_branches() { |
67389a94825a
zsh completion: add hg branches
Brendan Cully <brendan@kublai.com>
parents:
8983
diff
changeset
|
534 _arguments -s -w : $_hg_global_opts \ |
67389a94825a
zsh completion: add hg branches
Brendan Cully <brendan@kublai.com>
parents:
8983
diff
changeset
|
535 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' |
67389a94825a
zsh completion: add hg branches
Brendan Cully <brendan@kublai.com>
parents:
8983
diff
changeset
|
536 } |
67389a94825a
zsh completion: add hg branches
Brendan Cully <brendan@kublai.com>
parents:
8983
diff
changeset
|
537 |
3537 | 538 _hg_cmd_bundle() { |
539 _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
|
540 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
541 '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \ |
3537 | 542 ':output file:_files' \ |
543 ':destination repository:_files -/' | |
544 } | |
545 | |
546 _hg_cmd_cat() { | |
547 _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
|
548 '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
549 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
550 '*:file:_hg_files' |
3537 | 551 } |
552 | |
553 _hg_cmd_clone() { | |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
554 _arguments -s -w : $_hg_global_opts $_hg_clone_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
555 '(--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
|
556 '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \ |
3537 | 557 '--uncompressed[use uncompressed transfer (fast over LAN)]' \ |
558 ':source repository:_hg_remote' \ | |
3601
cedf056bb723
zsh: support remote cloning
Brendan Cully <brendan@kublai.com>
parents:
3600
diff
changeset
|
559 ':destination:_hg_clone_dest' |
3537 | 560 } |
561 | |
562 _hg_cmd_commit() { | |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
563 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ |
3666
adbf440a81e0
zsh: typo in commit completion
Brendan Cully <brendan@kublai.com>
parents:
3605
diff
changeset
|
564 '(--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
|
565 '(--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
|
566 '(--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
|
567 '(--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
|
568 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
569 '--amend[amend the parent of the working dir]' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
570 '*:file:_hg_files' |
3537 | 571 } |
572 | |
573 _hg_cmd_copy() { | |
574 _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
|
575 '(--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
|
576 '(--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
|
577 '*:file:_hg_files' |
3537 | 578 } |
579 | |
580 _hg_cmd_diff() { | |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
581 typeset -A opt_args |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
582 _arguments -s -w : $_hg_global_opts $_hg_diff_opts $_hg_ignore_space_opts \ |
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
583 $_hg_pat_opts $_hg_subrepos_opts \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
584 '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
585 '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \ |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
586 '*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
587 |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
588 if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
589 then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
590 if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
591 then |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
592 _hg_files |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
593 else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
594 _hg_modified |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
595 fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
596 fi |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
597 } |
1362 | 598 |
3537 | 599 _hg_cmd_export() { |
600 _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
|
601 '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \ |
3537 | 602 '--switch-parent[diff against the second parent]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
603 '*:revision:_hg_labels' |
3537 | 604 } |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
605 |
17397
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
606 _hg_cmd_forget() { |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
607 _arguments -s -w : $_hg_global_opts \ |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
608 '*:file:_hg_files' |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
609 } |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
610 |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
611 _hg_cmd_graft() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
612 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \ |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
613 $_hg_date_user_opts $_hg_mergetool_opts \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
614 '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
615 '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
616 '--log[append graft info to log message]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
617 '*:revision:_hg_labels' |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
618 } |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
619 |
3537 | 620 _hg_cmd_grep() { |
621 _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
|
622 '(--print0 -0)'{-0,--print0}'[end filenames with NUL]' \ |
3537 | 623 '--all[print all revisions with matches]' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
624 '(--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
|
625 '(--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
|
626 '(--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
|
627 '(--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
|
628 '*'{-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
|
629 '(--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
|
630 '1:search pattern:' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
631 '*:files:_hg_files' |
3537 | 632 } |
1362 | 633 |
3537 | 634 _hg_cmd_heads() { |
635 _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
636 '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels' |
3537 | 637 } |
638 | |
639 _hg_cmd_help() { | |
640 _arguments -s -w : $_hg_global_opts \ | |
17396
aaaeea31482a
zsh completion: complete additional topics for `help`, not commands only
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17004
diff
changeset
|
641 '*:mercurial help topic:_hg_help_topics' |
3537 | 642 } |
1362 | 643 |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
644 _hg_cmd_identify() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
645 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
646 '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
647 '(--num -n)'{-n+,--num}'[show local revision number]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
648 '(--id -i)'{-i+,--id}'[show global revision id]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
649 '(--branch -b)'{-b+,--branch}'[show branch]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
650 '(--tags -t)'{-t+,--tags}'[show tags]' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
651 } |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
652 |
3537 | 653 _hg_cmd_import() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
654 _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
|
655 '(--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
|
656 '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
657 '--bypass[apply patch without touching the working directory]' \ |
3537 | 658 '*:patch:_files' |
659 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
660 |
3537 | 661 _hg_cmd_incoming() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
662 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \ |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
663 $_hg_subrepos_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
664 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
665 '(--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
|
666 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 667 '--bundle[file to store the bundles into]:bundle file:_files' \ |
668 ':source:_hg_remote' | |
669 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
670 |
3537 | 671 _hg_cmd_init() { |
672 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
673 ':dir:_files -/' | |
674 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
675 |
3537 | 676 _hg_cmd_locate() { |
677 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
678 '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_labels' \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
679 '(--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
|
680 '(--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
|
681 '*:search pattern:_hg_files' |
3537 | 682 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
683 |
3537 | 684 _hg_cmd_log() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
685 _arguments -s -w : $_hg_log_opts $_hg_pat_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
686 '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \ |
3537 | 687 '(-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
|
688 '(--copies -C)'{-C,--copies}'[show copied files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
689 '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
690 '*'{-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
|
691 '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
692 '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \ |
15100
a051f8a6a7cc
contrib: some support for named branches in zsh_completion (issue2988)
Ben Hockey <neonstalwart@gmail.com>
parents:
13562
diff
changeset
|
693 '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
694 '*:files:_hg_files' |
3537 | 695 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
696 |
3537 | 697 _hg_cmd_manifest() { |
698 _arguments -s -w : $_hg_global_opts \ | |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
699 '--all[list files from all revisions]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
700 ':revision:_hg_labels' |
3537 | 701 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
702 |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
703 _hg_cmd_merge() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
704 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts \ |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
705 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ |
8986
7f349588665f
zsh completion: update bisect for builtin syntax
Brendan Cully <brendan@kublai.com>
parents:
8985
diff
changeset
|
706 '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
707 '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
708 ':revision:_hg_mergerevs' |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
709 } |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
710 |
3537 | 711 _hg_cmd_outgoing() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
712 _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \ |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
713 $_hg_subrepos_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
714 '(--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
|
715 '(--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
|
716 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ |
3537 | 717 ':destination:_hg_remote' |
718 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
719 |
3537 | 720 _hg_cmd_parents() { |
721 _arguments -s -w : $_hg_global_opts $_hg_style_opts \ | |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
722 '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_labels' \ |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
723 ':last modified file:_hg_files' |
3537 | 724 } |
725 | |
726 _hg_cmd_paths() { | |
727 _arguments -s -w : $_hg_global_opts \ | |
728 ':path:_hg_paths' | |
729 } | |
730 | |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
731 _hg_cmd_phase() { |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
732 _arguments -s -w : $_hg_global_opts \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
733 '(--public -p)'{-p,--public}'[set changeset phase to public]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
734 '(--draft -d)'{-d,--draft}'[set changeset phase to draft]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
735 '(--secret -s)'{-s,--secret}'[set changeset phase to secret]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
736 '(--force -f)'{-f,--force}'[allow to move boundary backward]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
737 '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
738 ':revision:_hg_labels' |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
739 } |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
740 |
3537 | 741 _hg_cmd_pull() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
742 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
743 '(--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
|
744 '(--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
|
745 '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ |
3537 | 746 ':source:_hg_remote' |
747 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
748 |
3537 | 749 _hg_cmd_push() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
750 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
751 '(--force -f)'{-f,--force}'[force push]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
752 '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \ |
3537 | 753 ':destination:_hg_remote' |
754 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
755 |
3537 | 756 _hg_cmd_remove() { |
757 _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
|
758 '(--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
|
759 '(--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
|
760 '*:file:_hg_files' |
3537 | 761 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
762 |
3537 | 763 _hg_cmd_rename() { |
764 _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
|
765 '(--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
|
766 '(--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
|
767 '*:file:_hg_files' |
3537 | 768 } |
1362 | 769 |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
770 _hg_cmd_resolve() { |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
771 local context state line |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
772 typeset -A opt_args |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
773 |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
774 _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \ |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
775 '(--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
|
776 '(--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
|
777 '(--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
|
778 '*:file:_hg_unresolved' |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
779 |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
780 if [[ $state == 'resolve_files' ]] |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
781 then |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
782 _alternative 'files:resolved files:_hg_resolved' \ |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
783 'files:unresolved files:_hg_unresolved' |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
784 fi |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
785 } |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
786 |
3537 | 787 _hg_cmd_revert() { |
7384
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
788 local context state line |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
789 typeset -A opt_args |
62b75d73c33d
zsh: support for resolve
Brendan Cully <brendan@kublai.com>
parents:
6804
diff
changeset
|
790 |
3537 | 791 _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
|
792 '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
793 '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
794 '(--no-backup -C)'{-C,--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
|
795 '*:file:->diff_files' |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
796 |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
797 if [[ $state == 'diff_files' ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
798 then |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
799 if [[ -n $opt_args[-r] ]] |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
800 then |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
801 _hg_files |
3587
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
802 else |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
803 typeset -a status_files |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
804 _hg_status mard |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
805 _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
|
806 fi |
c8494fcc9d39
zsh: tab-complete status results by directory
Brendan Cully <brendan@kublai.com>
parents:
3560
diff
changeset
|
807 fi |
3537 | 808 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
809 |
17397
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
810 _hg_cmd_rollback() { |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
811 _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \ |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
812 '(--force -f)'{-f,--force}'[ignore safety measures]' \ |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
813 } |
c785bb3ace29
zsh completion: add `forget` and `rollback` commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17396
diff
changeset
|
814 |
3537 | 815 _hg_cmd_serve() { |
816 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
817 '(--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
|
818 '(--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
|
819 '(--daemon -d)'{-d,--daemon}'[run server in background]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
820 '(--port -p)'{-p+,--port}'[listen port]:listen port:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
821 '(--address -a)'{-a+,--address}'[interface address]:interface address:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
822 '(--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
|
823 '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \ |
3537 | 824 '--style[web template style]:style' \ |
825 '--stdio[for remote clients]' \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
826 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' |
3537 | 827 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
828 |
5309
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
829 _hg_cmd_showconfig() { |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
830 _arguments -s -w : $_hg_global_opts \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
831 '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
832 ':config item:_hg_config' |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
833 } |
e21644bbf01e
Updated zsh completion from issue722.
Brendan Cully <brendan@kublai.com>
parents:
4441
diff
changeset
|
834 |
3537 | 835 _hg_cmd_status() { |
17399
dbff625679a1
zsh completion: add subrepos options for all supporting commands
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17398
diff
changeset
|
836 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
837 '(--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
|
838 '(--modified -m)'{-m,--modified}'[show only modified files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
839 '(--added -a)'{-a,--added}'[show only added files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
840 '(--removed -r)'{-r,--removed}'[show only removed files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
841 '(--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
|
842 '(--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
|
843 '(--unknown -u)'{-u,--unknown}'[show only unknown files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
844 '(--ignored -i)'{-i,--ignored}'[show ignored files]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
845 '(--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
|
846 '(--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
|
847 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
848 '--rev[show difference from revision]:revision:_hg_labels' \ |
3537 | 849 '*:files:_files' |
850 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
851 |
9923
c0b79fdfd214
zsh completion: add summary
Brendan Cully <brendan@kublai.com>
parents:
8986
diff
changeset
|
852 _hg_cmd_summary() { |
c0b79fdfd214
zsh completion: add summary
Brendan Cully <brendan@kublai.com>
parents:
8986
diff
changeset
|
853 _arguments -s -w : $_hg_global_opts \ |
c0b79fdfd214
zsh completion: add summary
Brendan Cully <brendan@kublai.com>
parents:
8986
diff
changeset
|
854 '--remote[check for push and pull]' |
c0b79fdfd214
zsh completion: add summary
Brendan Cully <brendan@kublai.com>
parents:
8986
diff
changeset
|
855 } |
c0b79fdfd214
zsh completion: add summary
Brendan Cully <brendan@kublai.com>
parents:
8986
diff
changeset
|
856 |
3537 | 857 _hg_cmd_tag() { |
858 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
859 '(--local -l)'{-l,--local}'[make the tag local]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
860 '(--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
|
861 '(--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
|
862 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
863 '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \ |
3537 | 864 ':tag name:' |
865 } | |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
866 |
3537 | 867 _hg_cmd_tip() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
868 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts $_hg_style_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
869 '(--patch -p)'{-p,--patch}'[show patch]' |
3537 | 870 } |
1438
c22da894e4cc
zsh completions: new -M, -m arguments for log, etc.
Steve Borho <steve@borho.org>
parents:
1368
diff
changeset
|
871 |
3537 | 872 _hg_cmd_unbundle() { |
873 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
874 '(--update -u)'{-u,--update}'[update to new tip if changesets were unbundled]' \ |
3537 | 875 ':files:_files' |
876 } | |
1362 | 877 |
3537 | 878 _hg_cmd_update() { |
879 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
880 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
881 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \ |
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
882 ':revision:_hg_labels' |
3537 | 883 } |
1362 | 884 |
12169
b62276658844
zsh completion: bookmarks support
Brendan Cully <brendan@kublai.com>
parents:
12168
diff
changeset
|
885 ## extensions ## |
b62276658844
zsh completion: bookmarks support
Brendan Cully <brendan@kublai.com>
parents:
12168
diff
changeset
|
886 |
3537 | 887 # HGK |
888 _hg_cmd_view() { | |
889 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
890 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
3537 | 891 ':revision range:_hg_tags' |
892 } | |
1362 | 893 |
3537 | 894 # MQ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
895 _hg_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
896 typeset -a patches |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
897 patches=(${(f)"$(_hg_cmd qseries)"}) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
898 (( $#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
|
899 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
900 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
901 _hg_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
902 typeset -a patches |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
903 patches=(${(f)"$(_hg_cmd qapplied)"}) |
3549
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
904 if (( $#patches )) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
905 then |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
906 patches+=(qbase qtip) |
3dbec3f6d3a2
zsh: add qbase and qtip to qapplied completions
Brendan Cully <brendan@kublai.com>
parents:
3548
diff
changeset
|
907 _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
|
908 fi |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
909 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
910 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
911 _hg_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
912 typeset -a patches |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
913 patches=(${(f)"$(_hg_cmd qunapplied)"}) |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
914 (( $#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
|
915 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
916 |
8980
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
917 # unapplied, including guarded patches |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
918 _hg_qdeletable() { |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
919 typeset -a unapplied |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
920 unapplied=(${(f)"$(_hg_cmd qseries)"}) |
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
921 for p in $(_hg_cmd qapplied) |
8980
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
922 do |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
923 unapplied=(${unapplied:#$p}) |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
924 done |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
925 |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
926 (( $#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
|
927 } |
6d5dca8737b9
zsh completion: include guarded patches in qdelete
Brendan Cully <brendan@kublai.com>
parents:
8961
diff
changeset
|
928 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
929 _hg_qguards() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
930 typeset -a guards |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
931 local guard |
3543
fe9c1e886b5e
zsh: complete qguard with +/- guard prefixes
Brendan Cully <brendan@kublai.com>
parents:
3541
diff
changeset
|
932 compset -P "+|-" |
8983
0701044ad156
zsh completion: basic merge support
Brendan Cully <brendan@kublai.com>
parents:
8982
diff
changeset
|
933 _hg_cmd qselect -s | while read guard |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
934 do |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
935 guards+=(${guard#(+|-)}) |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
936 done |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
937 (( $#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
|
938 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
939 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
940 _hg_qseries_opts=( |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
941 '(--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
|
942 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
943 _hg_cmd_qapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
944 _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
|
945 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
946 |
3537 | 947 _hg_cmd_qdelete() { |
948 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
949 '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
950 '*'{-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
|
951 '*:unapplied patch:_hg_qdeletable' |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
952 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
953 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
954 _hg_cmd_qdiff() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
955 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \ |
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
956 $_hg_ignore_space_opts \ |
3603
ef9c515836ae
zsh: compute repository root instead of forking hg
Brendan Cully <brendan@kublai.com>
parents:
3602
diff
changeset
|
957 '*:pattern:_hg_files' |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
958 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
959 |
15645
88a82069be4a
zsh completion: add support for qfinish
Augie Fackler <durin42@gmail.com>
parents:
15100
diff
changeset
|
960 _hg_cmd_qfinish() { |
88a82069be4a
zsh completion: add support for qfinish
Augie Fackler <durin42@gmail.com>
parents:
15100
diff
changeset
|
961 _arguments -s -w : $_hg_global_opts \ |
16330
a5a3af000e0d
zsh completion: fix error in qfinish completions from 88a82069be4a
Augie Fackler <durin42@gmail.com>
parents:
15645
diff
changeset
|
962 '(--applied -a)'{-a,--applied}'[finish all applied patches]' \ |
15645
88a82069be4a
zsh completion: add support for qfinish
Augie Fackler <durin42@gmail.com>
parents:
15100
diff
changeset
|
963 '*:patch:_hg_qapplied' |
88a82069be4a
zsh completion: add support for qfinish
Augie Fackler <durin42@gmail.com>
parents:
15100
diff
changeset
|
964 } |
88a82069be4a
zsh completion: add support for qfinish
Augie Fackler <durin42@gmail.com>
parents:
15100
diff
changeset
|
965 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
966 _hg_cmd_qfold() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
967 _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
|
968 '(--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
|
969 '*:unapplied patch:_hg_qunapplied' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
970 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
971 |
5868
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
972 _hg_cmd_qgoto() { |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
973 _arguments -s -w : $_hg_global_opts \ |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
974 '(--force -f)'{-f,--force}'[overwrite any local changes]' \ |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
975 ':patch:_hg_qseries' |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
976 } |
838fa52abcc1
[PATCH] zsh_completion tag/mq fixes
Nicholas Riley <njriley@uiuc.edu>
parents:
5309
diff
changeset
|
977 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
978 _hg_cmd_qguard() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
979 _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
|
980 '(--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
|
981 '(--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
|
982 ':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
983 '*:guards:_hg_qguards' |
3537 | 984 } |
1362 | 985 |
3537 | 986 _hg_cmd_qheader() { |
987 _arguments -s -w : $_hg_global_opts \ | |
988 ':patch:_hg_qseries' | |
989 } | |
1362 | 990 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
991 _hg_cmd_qimport() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
992 _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts \ |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
993 '(--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
|
994 '(--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
|
995 '(--force -f)'{-f,--force}'[overwrite existing files]' \ |
3550
ef80b13df85a
zsh: add revrange completion
Brendan Cully <brendan@kublai.com>
parents:
3549
diff
changeset
|
996 '*'{-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
|
997 '*:patch:_files' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
998 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
999 |
3537 | 1000 _hg_cmd_qnew() { |
1001 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ | |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
1002 $_hg_date_user_opts $_hg_gitlike_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1003 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
3537 | 1004 ':patch:' |
1005 } | |
1368
d1d605d1e839
Fix completion function for 'hg pull'. Fix truncation bug and remove tabs.
Steve Borho <steve@borho.org>
parents:
1365
diff
changeset
|
1006 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1007 _hg_cmd_qnext() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1008 _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
|
1009 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1010 |
3537 | 1011 _hg_cmd_qpop() { |
1012 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1013 '(--all -a :)'{-a,--all}'[pop all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1014 '(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1015 '(--force -f)'{-f,--force}'[forget any local changes]' \ |
3537 | 1016 ':patch:_hg_qapplied' |
1017 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
1018 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1019 _hg_cmd_qprev() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1020 _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
|
1021 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1022 |
3537 | 1023 _hg_cmd_qpush() { |
1024 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1025 '(--all -a :)'{-a,--all}'[apply all patches]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1026 '(--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
|
1027 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1028 '(--name -n)'{-n+,--name}'[merge queue name]:' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1029 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1030 '(--exact -e)'{-e,--exact}'[apply the target patch to its recorded parent]' \ |
11760
46039b2af349
zsh completions: add qpush --move option
Yuya Nishihara <yuya@tcha.org>
parents:
11646
diff
changeset
|
1031 '--move[reorder patch series and apply only the patch]' \ |
3537 | 1032 ':patch:_hg_qunapplied' |
1033 } | |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
1034 |
3537 | 1035 _hg_cmd_qrefresh() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
1036 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts $_hg_gitlike_opts \ |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1037 '(--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
|
1038 '(--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
|
1039 '*:files:_hg_files' |
3537 | 1040 } |
3487
46958e428fcd
zsh completion: basic mq support
Brendan Cully <brendan@kublai.com>
parents:
1544
diff
changeset
|
1041 |
3541
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1042 _hg_cmd_qrename() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1043 _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
|
1044 ':patch:_hg_qseries' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1045 ':destination:' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1046 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1047 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1048 _hg_cmd_qselect() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1049 _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
|
1050 '(--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
|
1051 '(--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
|
1052 '--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
|
1053 '--reapply[pop and reapply patches]' \ |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1054 '*:guards:_hg_qguards' |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1055 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1056 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1057 _hg_cmd_qseries() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1058 _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
|
1059 '(--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
|
1060 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1061 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1062 _hg_cmd_qunapplied() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1063 _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
|
1064 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1065 |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1066 _hg_cmd_qtop() { |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1067 _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
|
1068 } |
ee6b8de6df3c
zsh: complete qapplied, qdiff, qfold, qguard, qimport, qnext, qprev
Brendan Cully <brendan@kublai.com>
parents:
3539
diff
changeset
|
1069 |
3537 | 1070 _hg_cmd_strip() { |
1071 _arguments -s -w : $_hg_global_opts \ | |
3539
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1072 '(--force -f)'{-f,--force}'[force multi-head removal]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1073 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
a6dd7ab568cc
zsh: make option lists more compact
Brendan Cully <brendan@kublai.com>
parents:
3537
diff
changeset
|
1074 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
1075 ':revision:_hg_labels' |
3537 | 1076 } |
3493
1b9494d2b070
zsh: expand tags lazily
Brendan Cully <brendan@kublai.com>
parents:
3487
diff
changeset
|
1077 |
12168
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1078 # Patchbomb |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1079 _hg_cmd_email() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
1080 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_gitlike_opts \ |
12168
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1081 '--plain[omit hg patch header]' \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1082 '--body[send patches as inline message text (default)]' \ |
12168
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1083 '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1084 '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1085 '--bundlename[name of the bundle attachment file (default: bundle)]:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1086 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1087 '--force[run even when remote repository is unrelated (with -b/--bundle)]' \ |
13511
392b5684d0b4
zsh completion: complete bookmarks where they are accepted
Augie Fackler <durin42@gmail.com>
parents:
12169
diff
changeset
|
1088 '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_labels' \ |
12168
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1089 '--intro[send an introduction email for a single patch]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1090 '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1091 '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1092 '*--bcc[email addresses of blind carbon copy recipients]:email:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1093 '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1094 '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1095 '--date[use the given date as the sending date]:date:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1096 '--desc[use the given file as the series description]:files:_files' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1097 '(--from -f)'{-f,--from}'[email address of sender]:email:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1098 '(--test -n)'{-n,--test}'[print messages that would be sent]' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1099 '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1100 '*--reply-to[email addresses replies should be sent to]:email:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1101 '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1102 '--in-reply-to[message identifier to reply to]:msgid:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1103 '*--flag[flags to add in subject prefixes]:flag:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1104 '*'{-t,--to}'[email addresses of recipients]:email:' \ |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1105 ':revision:_hg_revrange' |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1106 } |
ff4597f521a4
zsh completion: patchbomb support
Brendan Cully <brendan@kublai.com>
parents:
11760
diff
changeset
|
1107 |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1108 # Rebase |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1109 _hg_cmd_rebase() { |
17398
b290d3b1c1b8
zsh completion: add new option groups for options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
17397
diff
changeset
|
1110 _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_mergetool_opts \ |
17004
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1111 '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1112 '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1113 '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1114 '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1115 '--collapse[collapse the rebased changeset]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1116 '--keep[keep original changeset]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1117 '--keepbranches[keep original branch name]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1118 '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1119 '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \ |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1120 } |
a1d86396d8c1
zsh completion: catch up with 2.2 commands and options
Nikolaj Sjujskij <sterkrig@myopera.com>
parents:
16330
diff
changeset
|
1121 |
3537 | 1122 _hg "$@" |