##// 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 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 99 # this is "kind of" ugly...
93 100 _hg_count_non_option()
94 101 {
@@ -189,9 +196,11 b' shopt -s extglob'
189 196 if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
190 197 if [ $canonical = 1 ]; then
191 198 _hg_tags
199 _hg_branches
192 200 return 0
193 201 elif [[ status != "$cmd"* ]]; then
194 202 _hg_tags
203 _hg_branches
195 204 return 0
196 205 else
197 206 return 1
@@ -207,9 +216,11 b' shopt -s extglob'
207 216 return 0
208 217 fi
209 218 _hg_tags
219 _hg_branches
210 220 ;;
211 221 manifest|update)
212 222 _hg_tags
223 _hg_branches
213 224 ;;
214 225 pull|push|outgoing|incoming)
215 226 _hg_paths
@@ -223,6 +234,7 b' shopt -s extglob'
223 234 ;;
224 235 merge)
225 236 _hg_tags
237 _hg_branches
226 238 ;;
227 239 commit)
228 240 _hg_status "mar"
@@ -338,6 +350,7 b' complete -o bashdefault -o default -F _h'
338 350 _hg_cmd_strip()
339 351 {
340 352 _hg_tags
353 _hg_branches
341 354 }
342 355
343 356 _hg_cmd_qcommit()
@@ -446,6 +459,7 b' complete -o bashdefault -o default -F _h'
446 459 case "$subcmd" in
447 460 good|bad)
448 461 _hg_tags
462 _hg_branches
449 463 ;;
450 464 esac
451 465
@@ -482,6 +496,7 b' complete -o bashdefault -o default -F _h'
482 496 esac
483 497
484 498 _hg_tags
499 _hg_branches
485 500 return
486 501 }
487 502
@@ -490,6 +505,7 b' complete -o bashdefault -o default -F _h'
490 505 _hg_cmd_sign()
491 506 {
492 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 527 # all other transplant options values and command parameters are revisions
512 528 _hg_tags
529 _hg_branches
513 530 return
514 531 }
515 532
General Comments 0
You need to be logged in to leave comments. Login now