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

login
register
mail settings
Submitter Sean Farley
Date Nov. 26, 2013, 1:37 a.m.
Message ID <8284d077161322221f0d.1385429835@laptop.local>
Download mbox | patch
Permalink /patch/3150/
State Superseded
Commit 56df59cc4212853fdbeebe3e6475e924a3e6c70a
Headers show

Comments

Sean Farley - Nov. 26, 2013, 1:37 a.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@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

Patch

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"))