# HG changeset patch # User Johannes Schlatow # Date 2013-01-16 23:54:49 # Node ID c2792fe150252ec8249efc593d1409bc1b7a3e0f # Parent 45bb5df43b81c3685ba57f9475534aafb0ae3eb6 zsh_completion: add completion of branch names diff --git a/contrib/zsh_completion b/contrib/zsh_completion --- a/contrib/zsh_completion +++ b/contrib/zsh_completion @@ -213,6 +213,13 @@ typeset -A _hg_cmd_globals 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() {