Patchwork improving zsh completion by adding branch names to merge revisions

login
register
mail settings
Submitter Johannes Schlatow
Date Jan. 17, 2013, 12:58 a.m.
Message ID <50F74CC1.5070909@schlatow.name>
Download mbox | patch
Permalink /patch/673/
State Superseded
Commit 26627c30735a610f59979a36885b327b25d8dbff
Delegated to: Matt Mackall
Headers show

Comments

Johannes Schlatow - Jan. 17, 2013, 12:58 a.m.
# HG changeset patch
# User Johannes Schlatow <johannes@schlatow.name>
# Date 1358380489 -3600
# Node ID 6d851c829427e8f85f5640c8c1333715fd7b1f37
# Parent  5db16424142c5a52a2fbdcd5db20e8deec355028
zsh_completion: add completion of branch names

Patch

diff -r 5db16424142c -r 6d851c829427 contrib/zsh_completion
--- a/contrib/zsh_completion    Wed Jan 09 19:10:44 2013 -0600
+++ b/contrib/zsh_completion    Thu Jan 17 00:54:49 2013 +0100
@@ -214,6 +214,13 @@ 
   heads=(${heads:#$myrev})

   (( $#heads )) && _describe -t heads 'heads' heads
+
+  branches=(${(f)"$(_hg_cmd heads --template '{branch}\\n')"})
+  # exclude own revision
+  myrev=$(_hg_cmd log -r . --template '{branch}\\n')
+  branches=(${branches:#$myrev})
+
+  (( $#branches )) && _describe -t branches 'branches' branches
 }

 _hg_files() {