Patchwork [10,of,15,V5] bash_completion: add _hg_branches for list of branches

login
register
mail settings
Submitter Sean Farley
Date Nov. 26, 2013, 7:54 p.m.
Message ID <e5eb668a5d0bd5643192.1385499289@laptop.local>
Download mbox | patch
Permalink /patch/3164/
State Accepted
Commit 56df59cc4212853fdbeebe3e6475e924a3e6c70a
Headers show

Comments

Sean Farley - Nov. 26, 2013, 7:54 p.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 e5eb668a5d0bd5643192f2239d813e2e7a81a39f
# Parent  20eba6f9931155d472498c4813159873d5ee35b9
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"))