Show More
@@ -139,7 +139,7 b' typeset -A _hg_cmd_globals' | |||
|
139 | 139 | typeset -gA _hg_alias_list |
|
140 | 140 | local hline cmd cmdalias |
|
141 | 141 | |
|
142 |
_call_program hg hg debugcomplete -v |
|
|
142 | _call_program hg hg debugcomplete -v | while read -A hline | |
|
143 | 143 | do |
|
144 | 144 | cmd=$hline[1] |
|
145 | 145 | _hg_cmd_list+=($cmd) |
@@ -166,13 +166,26 b' typeset -A _hg_cmd_globals' | |||
|
166 | 166 | typeset -a tags |
|
167 | 167 | local tag rev |
|
168 | 168 | |
|
169 |
_hg_cmd tags |
|
|
169 | _hg_cmd tags | while read tag | |
|
170 | 170 | do |
|
171 | 171 | tags+=(${tag/ # [0-9]#:*}) |
|
172 | 172 | done |
|
173 | 173 | (( $#tags )) && _describe -t tags 'tags' tags |
|
174 | 174 | } |
|
175 | 175 | |
|
176 | # likely merge candidates | |
|
177 | _hg_mergerevs() { | |
|
178 | typeset -a heads | |
|
179 | local myrev | |
|
180 | ||
|
181 | heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) | |
|
182 | # exclude own revision | |
|
183 | myrev=$(_hg_cmd log -r . --template '{rev}\\n') | |
|
184 | heads=(${heads:#$myrev}) | |
|
185 | ||
|
186 | (( $#heads )) && _describe -t heads 'heads' heads | |
|
187 | } | |
|
188 | ||
|
176 | 189 | _hg_files() { |
|
177 | 190 | if [[ -n "$_hg_root" ]] |
|
178 | 191 | then |
@@ -192,7 +205,7 b' typeset -A _hg_cmd_globals' | |||
|
192 | 205 | |
|
193 | 206 | _hg_status() { |
|
194 | 207 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
|
195 |
status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX |
|
|
208 | status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) | |
|
196 | 209 | } |
|
197 | 210 | |
|
198 | 211 | _hg_unknown() { |
@@ -214,11 +227,11 b' typeset -A _hg_cmd_globals' | |||
|
214 | 227 | } |
|
215 | 228 | |
|
216 | 229 | _hg_resolve() { |
|
217 | local rstate rpah | |
|
230 | local rstate rpath | |
|
218 | 231 | |
|
219 | 232 | [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
|
220 | 233 | |
|
221 |
_hg_cmd resolve -l ./$PREFIX |
|
|
234 | _hg_cmd resolve -l ./$PREFIX | while read rstate rpath | |
|
222 | 235 | do |
|
223 | 236 | [[ $rstate == 'R' ]] && resolved_files+=($rpath) |
|
224 | 237 | [[ $rstate == 'U' ]] && unresolved_files+=($rpath) |
@@ -262,7 +275,7 b' typeset -A _hg_cmd_globals' | |||
|
262 | 275 | compset -P '*/' |
|
263 | 276 | if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" |
|
264 | 277 | then |
|
265 |
remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" |
|
|
278 | remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) | |
|
266 | 279 | _store_cache "$cacheid" remdirs |
|
267 | 280 | fi |
|
268 | 281 | _describe -t directories 'remote directory' remdirs -S/ |
@@ -300,7 +313,7 b' typeset -A _hg_cmd_globals' | |||
|
300 | 313 | |
|
301 | 314 | _hg_paths() { |
|
302 | 315 | typeset -a paths pnames |
|
303 |
_hg_cmd paths |
|
|
316 | _hg_cmd paths | while read -A pnames | |
|
304 | 317 | do |
|
305 | 318 | paths+=($pnames[1]) |
|
306 | 319 | done |
@@ -365,7 +378,7 b' typeset -A _hg_cmd_globals' | |||
|
365 | 378 | |
|
366 | 379 | _hg_cmd() { |
|
367 | 380 | _call_program hg hg --config ui.verbose=0 --config defaults."$1"= \ |
|
368 | "$_hg_cmd_globals[@]" "$@" | |
|
381 | "$_hg_cmd_globals[@]" "$@" 2> /dev/null | |
|
369 | 382 | } |
|
370 | 383 | |
|
371 | 384 | _hg_cmd_add() { |
@@ -565,6 +578,14 b' typeset -A _hg_cmd_globals' | |||
|
565 | 578 | ':revision:_hg_tags' |
|
566 | 579 | } |
|
567 | 580 | |
|
581 | _hg_cmd_merge() { | |
|
582 | _arguments -s -w : $_hg_global_opts \ | |
|
583 | '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ | |
|
584 | '(--rev -r)'{-r,--rev}'[revision to merge]:revision:_hg_tags' \ | |
|
585 | '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ | |
|
586 | ':revision:_hg_mergerevs' | |
|
587 | } | |
|
588 | ||
|
568 | 589 | _hg_cmd_outgoing() { |
|
569 | 590 | _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
|
570 | 591 | '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
@@ -735,13 +756,13 b' typeset -A _hg_cmd_globals' | |||
|
735 | 756 | # MQ |
|
736 | 757 | _hg_qseries() { |
|
737 | 758 | typeset -a patches |
|
738 |
patches=(${(f)"$(_hg_cmd qseries |
|
|
759 | patches=(${(f)"$(_hg_cmd qseries)"}) | |
|
739 | 760 | (( $#patches )) && _describe -t hg-patches 'patches' patches |
|
740 | 761 | } |
|
741 | 762 | |
|
742 | 763 | _hg_qapplied() { |
|
743 | 764 | typeset -a patches |
|
744 |
patches=(${(f)"$(_hg_cmd qapplied |
|
|
765 | patches=(${(f)"$(_hg_cmd qapplied)"}) | |
|
745 | 766 | if (( $#patches )) |
|
746 | 767 | then |
|
747 | 768 | patches+=(qbase qtip) |
@@ -751,15 +772,15 b' typeset -A _hg_cmd_globals' | |||
|
751 | 772 | |
|
752 | 773 | _hg_qunapplied() { |
|
753 | 774 | typeset -a patches |
|
754 |
patches=(${(f)"$(_hg_cmd qunapplied |
|
|
775 | patches=(${(f)"$(_hg_cmd qunapplied)"}) | |
|
755 | 776 | (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
|
756 | 777 | } |
|
757 | 778 | |
|
758 | 779 | # unapplied, including guarded patches |
|
759 | 780 | _hg_qdeletable() { |
|
760 | 781 | typeset -a unapplied |
|
761 |
unapplied=(${(f)"$(_hg_cmd qseries |
|
|
762 |
for p in $(_hg_cmd qapplied |
|
|
782 | unapplied=(${(f)"$(_hg_cmd qseries)"}) | |
|
783 | for p in $(_hg_cmd qapplied) | |
|
763 | 784 | do |
|
764 | 785 | unapplied=(${unapplied:#$p}) |
|
765 | 786 | done |
@@ -771,7 +792,7 b' typeset -A _hg_cmd_globals' | |||
|
771 | 792 | typeset -a guards |
|
772 | 793 | local guard |
|
773 | 794 | compset -P "+|-" |
|
774 |
_hg_cmd qselect -s |
|
|
795 | _hg_cmd qselect -s | while read guard | |
|
775 | 796 | do |
|
776 | 797 | guards+=(${guard#(+|-)}) |
|
777 | 798 | done |
General Comments 0
You need to be logged in to leave comments.
Login now