zsh-workers
 help / color / mirror / code / Atom feed
* [patch] _hg: extend completion for hg push to support branch and bookmark
@ 2015-09-24 15:23 Christoph Mathys
  2015-09-24 16:15 ` Daniel Shahaf
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Mathys @ 2015-09-24 15:23 UTC (permalink / raw)
  To: zsh-workers

Hi again.

Below another small patch to extend the completion for mercurials 'hg
push' to also support -b/-B.

thx,
Christoph

PS Please CC on reply, I'm not subscribed.

diff --git a/Completion/Unix/Command/_hg b/Completion/Unix/Command/_hg
index edd7f0d..856edcf 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 hgtags
+  hgtags=( ${(f)"$(_hg_cmd branches -q 2>/dev/null)"} )
+  _wanted tags expl 'branches' compadd -a - hgtags
+}
+
 _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'
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] _hg: extend completion for hg push to support branch and bookmark
  2015-09-24 15:23 [patch] _hg: extend completion for hg push to support branch and bookmark Christoph Mathys
@ 2015-09-24 16:15 ` Daniel Shahaf
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Shahaf @ 2015-09-24 16:15 UTC (permalink / raw)
  To: Christoph Mathys; +Cc: zsh-workers

Christoph Mathys wrote on Thu, Sep 24, 2015 at 17:23:06 +0200:
> Below another small patch to extend the completion for mercurials 'hg
> push' to also support -b/-B.

Thanks, pushed with minor changes.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-24 16:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-24 15:23 [patch] _hg: extend completion for hg push to support branch and bookmark Christoph Mathys
2015-09-24 16:15 ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).