##// END OF EJS Templates
bash_completion: complete bookmarks...
Kevin Bullock -
r13509:8aea95ec stable
parent child Browse files
Show More
@@ -101,6 +101,20 b' shopt -s extglob'
101 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$branches' -- "$cur"))
101 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$branches' -- "$cur"))
102 }
102 }
103
103
104 _hg_bookmarks()
105 {
106 local bookmarks="$(_hg_cmd bookmarks -q)"
107 local IFS=$'\n'
108 COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$bookmarks' -- "$cur"))
109 }
110
111 _hg_labels()
112 {
113 _hg_tags
114 _hg_branches
115 _hg_bookmarks
116 }
117
104 # this is "kind of" ugly...
118 # this is "kind of" ugly...
105 _hg_count_non_option()
119 _hg_count_non_option()
106 {
120 {
@@ -200,12 +214,10 b' shopt -s extglob'
200
214
201 if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
215 if [ "$cmd" != status ] && [ "$prev" = -r ] || [ "$prev" == --rev ]; then
202 if [ $canonical = 1 ]; then
216 if [ $canonical = 1 ]; then
203 _hg_tags
217 _hg_labels
204 _hg_branches
205 return 0
218 return 0
206 elif [[ status != "$cmd"* ]]; then
219 elif [[ status != "$cmd"* ]]; then
207 _hg_tags
220 _hg_labels
208 _hg_branches
209 return 0
221 return 0
210 else
222 else
211 return 1
223 return 1
@@ -220,12 +232,10 b' shopt -s extglob'
220 if _hg_ext_mq_patchlist qapplied && [ "${COMPREPLY[*]}" ]; then
232 if _hg_ext_mq_patchlist qapplied && [ "${COMPREPLY[*]}" ]; then
221 return 0
233 return 0
222 fi
234 fi
223 _hg_tags
235 _hg_labels
224 _hg_branches
225 ;;
236 ;;
226 manifest|update)
237 manifest|update)
227 _hg_tags
238 _hg_labels
228 _hg_branches
229 ;;
239 ;;
230 pull|push|outgoing|incoming)
240 pull|push|outgoing|incoming)
231 _hg_paths
241 _hg_paths
@@ -238,8 +248,7 b' shopt -s extglob'
238 _hg_status "u"
248 _hg_status "u"
239 ;;
249 ;;
240 merge)
250 merge)
241 _hg_tags
251 _hg_labels
242 _hg_branches
243 ;;
252 ;;
244 commit|record)
253 commit|record)
245 _hg_status "mar"
254 _hg_status "mar"
@@ -378,8 +387,7 b' complete -o bashdefault -o default -F _h'
378
387
379 _hg_cmd_strip()
388 _hg_cmd_strip()
380 {
389 {
381 _hg_tags
390 _hg_labels
382 _hg_branches
383 }
391 }
384
392
385 _hg_cmd_qcommit()
393 _hg_cmd_qcommit()
@@ -497,8 +505,7 b' complete -o bashdefault -o default -F _h'
497
505
498 case "$subcmd" in
506 case "$subcmd" in
499 good|bad)
507 good|bad)
500 _hg_tags
508 _hg_labels
501 _hg_branches
502 ;;
509 ;;
503 esac
510 esac
504
511
@@ -534,8 +541,7 b' complete -o bashdefault -o default -F _h'
534 ;;
541 ;;
535 esac
542 esac
536
543
537 _hg_tags
544 _hg_labels
538 _hg_branches
539 return
545 return
540 }
546 }
541
547
@@ -543,8 +549,7 b' complete -o bashdefault -o default -F _h'
543 # gpg
549 # gpg
544 _hg_cmd_sign()
550 _hg_cmd_sign()
545 {
551 {
546 _hg_tags
552 _hg_labels
547 _hg_branches
548 }
553 }
549
554
550
555
@@ -564,8 +569,7 b' complete -o bashdefault -o default -F _h'
564 esac
569 esac
565
570
566 # all other transplant options values and command parameters are revisions
571 # all other transplant options values and command parameters are revisions
567 _hg_tags
572 _hg_labels
568 _hg_branches
569 return
573 return
570 }
574 }
571
575
General Comments 0
You need to be logged in to leave comments. Login now