# HG changeset patch # User Alexis S. L. Carvalho # Date 1161489720 10800 # Node ID a8823e6824fc408ee36354e2c29613493184b7fb # Parent 34cc82c6c7c21bacb3a549d32d1072aee149a478 bash_completion: qfold, qrename, qheader, qclone and qselect diff --git a/contrib/bash_completion b/contrib/bash_completion --- a/contrib/bash_completion +++ b/contrib/bash_completion @@ -328,6 +328,41 @@ complete -o bashdefault -o default -F _h COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur")) } +_hg_cmd_qfold() +{ + _hg_ext_mq_patchlist qunapplied +} + +_hg_cmd_qrename() +{ + _hg_ext_mq_patchlist qseries +} + +_hg_cmd_qheader() +{ + _hg_ext_mq_patchlist qseries +} + +_hg_cmd_qclone() +{ + local count=$(_hg_count_non_option) + if [ $count = 1 ]; then + _hg_paths + fi + _hg_repos +} + +_hg_ext_mq_guards() +{ + "$hg" qselect --series 2>/dev/null | sed -e 's/^.//' +} + +_hg_cmd_qselect() +{ + local guards=$(_hg_ext_mq_guards) + COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$guards' -- "$cur")) +} + # hbisect _hg_cmd_bisect()