D5142: zsh_completion: add -l/--list flag for hg bookmarks completion

av6 (Anton Shestakov) phabricator at mercurial-scm.org
Wed Oct 17 15:49:47 UTC 2018


av6 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Flags in parentheses are mutually exclusive. Logic is taken from commands.py:
  
    selactions = [k for k in ['delete', 'rename', 'list'] if opts.get(k)]
    if len(selactions) > 1:
        raise error.Abort(_('--%s and --%s are incompatible')
                          % tuple(selactions[:2]))
    
    ...
    
    if rev and action in {'delete', 'rename', 'list'}:
        raise error.Abort(_("--rev is incompatible with --%s") % action)
    if inactive and action in {'delete', 'list'}:
        raise error.Abort(_("--inactive is incompatible with --%s") % action)

REPOSITORY
  rHG Mercurial

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

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
@@ -532,10 +532,11 @@
 _hg_cmd_bookmarks() {
   _arguments -s -S : $_hg_global_opts \
   '(--force -f)'{-f,--force}'[force]' \
-  '(--inactive -i)'{-i,--inactive}'[mark a bookmark inactive]' \
-  '(--rev -r --delete -d --rename -m)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
-  '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \
-  '(--rev -r --delete -d --rename -m)'{-m+,--rename=}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
+  '(--inactive -i --delete -d --list -l)'{-i,--inactive}'[mark a bookmark inactive]' \
+  '(--rev -r --delete -d --rename -m --list -l)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
+  '(--rev -r --delete -d --rename -m --list -l --inactive -i)'{-d,--delete}'[delete a given bookmark]' \
+  '(--rev -r --delete -d --rename -m --list -l)'{-m+,--rename=}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
+  '(--inactive -i --delete -d --list -l)'{-l,--list}'[list existing bookmarks]' \
   ':bookmark:_hg_bookmarks'
 }
 



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


More information about the Mercurial-devel mailing list