[PATCH 09 of 11 V4] bash_completion: add _hg_branches for list of branches

Sean Farley sean.michael.farley at gmail.com
Mon Nov 25 19:37:15 CST 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1385397494 18000
#      Mon Nov 25 11:38:14 2013 -0500
# Node ID 8284d077161322221f0df02690107b5f70c31138
# Parent  a7932effc3c2c76dfc37bf70593b77b86bbaa3b5
bash_completion: add _hg_branches for list of branches

diff --git a/contrib/bash_completion b/contrib/bash_completion
--- a/contrib/bash_completion
+++ b/contrib/bash_completion
@@ -92,10 +92,17 @@
     local files="$(_hg_cmd status -n$1 "glob:$cur**")"
     local IFS=$'\n'
     COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$files' -- "$cur"))
 }
 
+_hg_branches()
+{
+    local branches="$(_hg_cmd branches -q)"
+    local IFS=$'\n'
+    COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$branches' -- "$cur"))
+}
+
 _hg_bookmarks()
 {
     local bookmarks="$(_hg_cmd bookmarks -q)"
     local IFS=$'\n'
     COMPREPLY=(${COMPREPLY[@]:-} $(compgen -W '$bookmarks' -- "$cur"))


More information about the Mercurial-devel mailing list