diff options
author | Christoph Mathys <eraserix@gmail.com> | 2015-09-24 16:12:27 +0000 |
---|---|---|
committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2015-09-24 16:12:57 +0000 |
commit | 1aafc028b392ae85f6670a1c0b8cf00da975e304 (patch) | |
tree | 948ddca59222841a6bcdd796768bc51caa22fdc0 /Completion | |
parent | 8d5c0c77609d814de7c0749602a595236f76b487 (diff) | |
download | zsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.tar.gz zsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.tar.xz zsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.zip |
36613: _hg: extend completion for hg push to support branch and bookmark
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Unix/Command/_hg | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg index e7c21b9d1..2db5c55a5 100644 --- a/Completion/Unix/Command/_hg +++ b/Completion/Unix/Command/_hg @@ -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' } |