1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-12-29 16:25:35 +01:00

36613: _hg: extend completion for hg push to support branch and bookmark

This commit is contained in:
Christoph Mathys 2015-09-24 16:12:27 +00:00 committed by Daniel Shahaf
parent 8d5c0c7760
commit 1aafc028b3
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2015-09-24 Christoph Mathys <eraserix@gmail.com>
* 36613: Completion/Unix/Command/_hg: _hg: extend completion
for hg push to support branch and bookmark
2015-09-23 Barton E. Schaefer <schaefer@zsh.org>
* 36604: Functions/Misc/zrecompile: fix getopts+shift calculation

View file

@ -176,6 +176,13 @@ _hg_bookmarks_internal() {
_wanted bookmarks expl 'bookmarks' compadd -a - hgbookmarks
}
_hg_branches_internal() {
local expl
typeset -a hgbranches
hgbranches=( ${(f)"$(_hg_cmd branches -q 2>/dev/null)"} )
_wanted branches expl 'branches' compadd -a - hgbranches
}
_hg_tags() {
_alternative \
'bookmarks:bookmark:_hg_bookmarks_internal' \
@ -659,6 +666,10 @@ _hg_cmd_push() {
_arguments -s -w : $_hg_global_opts $_hg_remote_opts \
'(--force -f)'{-f,--force}'[force push]' \
'(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \
'*'{-B,--bookmark=}'[bookmark to push]:bookmark:_hg_bookmarks_internal' \
'*'{-b,--branch=}'[branch to push]:branch:_hg_branches_internal' \
'--insecure[do not verify server certificate]' \
'--new-branch[allow pushing a new branch]' \
':destination:_hg_remote'
}