##// END OF EJS Templates
Support branch names in contrib/bash_completion...
Steve Losh -
r8719:b5e9ed63 default
parent child Browse files
Show More
@@ -89,6 +89,13 b' shopt -s extglob'
89 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur"))
89 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$tags' -- "$cur"))
90 }
90 }
91
91
92 _hg_branches()
93 {
94 local branches="$("$hg" branches -q 2>/dev/null)"
95 local IFS=$'\n'
96 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$branches' -- "$cur"))
97 }
98
92 # this is "kind of" ugly...
99 # this is "kind of" ugly...
93 _hg_count_non_option()
100 _hg_count_non_option()
94 {
101 {
@@ -189,9 +196,11 b' shopt -s extglob'
189 if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
196 if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
190 if [ $canonical = 1 ]; then
197 if [ $canonical = 1 ]; then
191 _hg_tags
198 _hg_tags
199 _hg_branches
192 return 0
200 return 0
193 elif [[ status != "$cmd"* ]]; then
201 elif [[ status != "$cmd"* ]]; then
194 _hg_tags
202 _hg_tags
203 _hg_branches
195 return 0
204 return 0
196 else
205 else
197 return 1
206 return 1
@@ -207,9 +216,11 b' shopt -s extglob'
207 return 0
216 return 0
208 fi
217 fi
209 _hg_tags
218 _hg_tags
219 _hg_branches
210 ;;
220 ;;
211 manifest|update)
221 manifest|update)
212 _hg_tags
222 _hg_tags
223 _hg_branches
213 ;;
224 ;;
214 pull|push|outgoing|incoming)
225 pull|push|outgoing|incoming)
215 _hg_paths
226 _hg_paths
@@ -223,6 +234,7 b' shopt -s extglob'
223 ;;
234 ;;
224 merge)
235 merge)
225 _hg_tags
236 _hg_tags
237 _hg_branches
226 ;;
238 ;;
227 commit)
239 commit)
228 _hg_status "mar"
240 _hg_status "mar"
@@ -338,6 +350,7 b' complete -o bashdefault -o default -F _h'
338 _hg_cmd_strip()
350 _hg_cmd_strip()
339 {
351 {
340 _hg_tags
352 _hg_tags
353 _hg_branches
341 }
354 }
342
355
343 _hg_cmd_qcommit()
356 _hg_cmd_qcommit()
@@ -446,6 +459,7 b' complete -o bashdefault -o default -F _h'
446 case "$subcmd" in
459 case "$subcmd" in
447 good|bad)
460 good|bad)
448 _hg_tags
461 _hg_tags
462 _hg_branches
449 ;;
463 ;;
450 esac
464 esac
451
465
@@ -482,6 +496,7 b' complete -o bashdefault -o default -F _h'
482 esac
496 esac
483
497
484 _hg_tags
498 _hg_tags
499 _hg_branches
485 return
500 return
486 }
501 }
487
502
@@ -490,6 +505,7 b' complete -o bashdefault -o default -F _h'
490 _hg_cmd_sign()
505 _hg_cmd_sign()
491 {
506 {
492 _hg_tags
507 _hg_tags
508 _hg_branches
493 }
509 }
494
510
495
511
@@ -510,6 +526,7 b' complete -o bashdefault -o default -F _h'
510
526
511 # all other transplant options values and command parameters are revisions
527 # all other transplant options values and command parameters are revisions
512 _hg_tags
528 _hg_tags
529 _hg_branches
513 return
530 return
514 }
531 }
515
532
General Comments 0
You need to be logged in to leave comments. Login now