From 1aafc028b392ae85f6670a1c0b8cf00da975e304 Mon Sep 17 00:00:00 2001 From: Christoph Mathys Date: Thu, 24 Sep 2015 16:12:27 +0000 Subject: 36613: _hg: extend completion for hg push to support branch and bookmark --- ChangeLog | 5 +++++ Completion/Unix/Command/_hg | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index e5044931f..dcecc8031 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-09-24 Christoph Mathys + + * 36613: Completion/Unix/Command/_hg: _hg: extend completion + for hg push to support branch and bookmark + 2015-09-23 Barton E. Schaefer * 36604: Functions/Misc/zrecompile: fix getopts+shift calculation 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' } -- cgit 1.4.1