From: Christoph Mathys <eraserix@gmail.com>
To: zsh-workers@zsh.org
Subject: [patch] _hg: extend completion for hg push to support branch and bookmark
Date: Thu, 24 Sep 2015 17:23:06 +0200 [thread overview]
Message-ID: <CALqGcGpViT1xezXNCii5iXUR6c8x8ONb4F7nu4O+_FRfKFXufg@mail.gmail.com> (raw)
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'
}
next reply other threads:[~2015-09-24 15:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 15:23 Christoph Mathys [this message]
2015-09-24 16:15 ` Daniel Shahaf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALqGcGpViT1xezXNCii5iXUR6c8x8ONb4F7nu4O+_FRfKFXufg@mail.gmail.com \
--to=eraserix@gmail.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).