about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristoph Mathys <eraserix@gmail.com>2015-09-24 16:12:27 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2015-09-24 16:12:57 +0000
commit1aafc028b392ae85f6670a1c0b8cf00da975e304 (patch)
tree948ddca59222841a6bcdd796768bc51caa22fdc0
parent8d5c0c77609d814de7c0749602a595236f76b487 (diff)
downloadzsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.tar.gz
zsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.tar.xz
zsh-1aafc028b392ae85f6670a1c0b8cf00da975e304.zip
36613: _hg: extend completion for hg push to support branch and bookmark
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_hg11
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e5044931f..dcecc8031 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
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'
 }