[PATCH] improving zsh completion by adding branch names to merge revisions

Johannes Schlatow johannes at schlatow.name
Wed Jan 16 18:58:41 CST 2013


# HG changeset patch
# User Johannes Schlatow <johannes at schlatow.name>
# Date 1358380489 -3600
# Node ID 6d851c829427e8f85f5640c8c1333715fd7b1f37
# Parent  5db16424142c5a52a2fbdcd5db20e8deec355028
zsh_completion: add completion of branch names

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() {


More information about the Mercurial-devel mailing list