D4612: zsh_completion: add -b/--branch and -B/--bookmark(s) flags properly

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Tue Sep 18 11:54:55 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3f11cb1aeb90: zsh_completion: add -b/--branch and -B/--bookmark(s) flags properly (authored by av6, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4612?vs=11107&id=11142

REVISION DETAIL
  https://phab.mercurial-scm.org/D4612

AFFECTED FILES
  contrib/zsh_completion

CHANGE DETAILS

diff --git a/contrib/zsh_completion b/contrib/zsh_completion
--- a/contrib/zsh_completion
+++ b/contrib/zsh_completion
@@ -464,11 +464,6 @@
   '--insecure[do not verify server certificate (ignoring web.cacerts config)]'
 )
 
-_hg_branch_bmark_opts=(
-  '(--bookmark -B)'{-B+,--bookmark=}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
-  '(--branch -b)'{-b+,--branch=}'[specify branch(es)]:branch:_hg_branches'
-)
-
 _hg_subrepos_opts=(
   '(--subrepos -S)'{-S,--subrepos}'[recurse into subrepositories]')
 
@@ -726,12 +721,13 @@
 }
 
 _hg_cmd_incoming() {
-  _arguments -s -S : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
-                     $_hg_subrepos_opts \
+  _arguments -s -S : $_hg_log_opts $_hg_remote_opts $_hg_subrepos_opts \
   '(--force -f)'{-f,--force}'[run even if remote repository is unrelated]' \
   '*'{-r+,--rev=}'[a remote changeset intended to be added]:revision:_hg_labels' \
   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   '--bundle=[file to store the bundles into]:bundle file:_files' \
+  '(--bookmarks -B)'{-B,--bookmarks}'[compare bookmarks]' \
+  '*'{-b+,--branch=}'[a specific branch you would like to pull]:branch:_hg_branches' \
   ':source:_hg_remote'
 }
 
@@ -779,11 +775,12 @@
 }
 
 _hg_cmd_outgoing() {
-  _arguments -s -S : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
-                     $_hg_subrepos_opts \
+  _arguments -s -S : $_hg_log_opts $_hg_remote_opts $_hg_subrepos_opts \
   '(--force -f)'{-f,--force}'[run even when the destination is unrelated]' \
   '*'{-r+,--rev=}'[a changeset intended to be included in the destination]:revision:_hg_revrange' \
   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
+  '(--bookmarks -B)'{-B,--bookmarks}'[compare bookmarks]' \
+  '*'{-b+,--branch=}'[a specific branch you would like to push]:branch:_hg_branches' \
   ':destination:_hg_remote'
 }
 
@@ -809,17 +806,21 @@
 }
 
 _hg_cmd_pull() {
-  _arguments -s -S : $_hg_global_opts $_hg_branch_bmark_opts $_hg_remote_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_remote_opts \
   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   '(--update -u)'{-u,--update}'[update to new branch head if new descendants were pulled]' \
   '*'{-r+,--rev=}'[a remote changeset intended to be added]:revision:_hg_labels' \
+  '*'{-B+,--bookmark=}'[bookmark to pull]:bookmark:_hg_bookmarks' \
+  '*'{-b+,--branch=}'[a specific branch you would like to pull]:branch:_hg_branches' \
   ':source:_hg_remote'
 }
 
 _hg_cmd_push() {
-  _arguments -s -S : $_hg_global_opts $_hg_branch_bmark_opts $_hg_remote_opts \
+  _arguments -s -S : $_hg_global_opts $_hg_remote_opts \
   '(--force -f)'{-f,--force}'[force push]' \
   '*'{-r+,--rev=}'[a changeset intended to be included in the destination]:revision:_hg_labels' \
+  '*'{-B+,--bookmark=}'[bookmark to push]:bookmark:_hg_bookmarks' \
+  '*'{-b+,--branch=}'[a specific branch you would like to push]:branch:_hg_branches' \
   '--new-branch[allow pushing a new branch]' \
   ':destination:_hg_remote'
 }



To: av6, #hg-reviewers, spectral, pulkit
Cc: mercurial-devel


More information about the Mercurial-devel mailing list