changeset 3484:a8823e6824fc

bash_completion: qfold, qrename, qheader, qclone and qselect
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 22 Oct 2006 01:02:00 -0300
parents 34cc82c6c7c2
children 26285469db9b
files contrib/bash_completion
diffstat 1 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/bash_completion	Sun Oct 22 01:01:52 2006 -0300
+++ b/contrib/bash_completion	Sun Oct 22 01:02:00 2006 -0300
@@ -328,6 +328,41 @@
     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()