zsh_completion: update some option usage flags ('+', '=' and ':')
authorAnton Shestakov <av6@dwimlabs.net>
Tue, 04 Oct 2016 20:49:59 +0800
changeset 30080 33e8a5a00007
parent 30079 84debea79903
child 30081 dd0ff715a82c
zsh_completion: update some option usage flags ('+', '=' and ':') Here are the relevant symbol descriptions from [0] optspec:... The colon indicates handling for one or more arguments to the option; if it is not present, the option is assumed to take no arguments. -optname+ The first argument may appear immediately after optname in the same word, or may appear as a separate word after the option. For example, ‘-foo+:...’ specifies that the completed option and argument will look like either ‘-fooarg’ or ‘-foo arg’. -optname= The argument may appear as the next word, or in same word as the option name provided that it is separated from it by an equals sign, for example ‘-foo=arg’ or ‘-foo arg’. There are 3 types of changes in this patch: - addition of '=': means that '--repository ~/foo' can now also be spelled as '--reporitory=~/foo' - addition of '+': means '-r 0' can now also be spelled as '-r0' - removal of '+', '=' and ':': means that '-u|--untrusted' doesn't take any arguments, so '-uq' is definitely '-u -q' and not '--untrusted=q' Occasionally, ':' had to be added together with '=' and '+'. This patch is mostly just making zsh_completion file look more like zsh's own hg completion file so that we can more easily take improvements from them or send patches to them. Some context for this patch from zsh project: [2] [3]. [0]: http://zsh.sourceforge.net/Doc/Release/Completion-System.html [1]: https://sourceforge.net/p/zsh/code/ci/master/tree/Completion/Unix/Command/_hg [2]: https://sourceforge.net/p/zsh/code/ci/92584634d3d39e9ca64475ae5af8010e2ccebe24/ [3]: http://www.zsh.org/mla/workers/2015/msg02551.html
contrib/zsh_completion
--- a/contrib/zsh_completion	Sat Oct 08 18:04:57 2016 +0200
+++ b/contrib/zsh_completion	Tue Oct 04 20:49:59 2016 +0800
@@ -371,7 +371,7 @@
 
 # Common options
 _hg_global_opts=(
-    '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/'
+    '(--repository -R)'{-R+,--repository=}'[repository root directory]:repository:_files -/'
     '--cwd[change working directory]:new working directory:_files -/'
     '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]'
     '(--verbose -v)'{-v,--verbose}'[enable additional output]'
@@ -390,8 +390,8 @@
 )
 
 _hg_pat_opts=(
-  '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
-  '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
+  '*'{-I+,--include=}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
+  '*'{-X+,--exclude=}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
 
 _hg_clone_opts=(
   $_hg_remote_opts
@@ -402,8 +402,8 @@
 _hg_date_user_opts=(
   '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]'
   '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]'
-  '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:'
-  '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:')
+  '(--date -d)'{-d+,--date=}'[record the specified date as commit date]:date:'
+  '(--user -u)'{-u+,--user=}'[record the specified user as committer]:user:')
 
 _hg_gitlike_opts=(
   '(--git -g)'{-g,--git}'[use git extended diff format]')
@@ -414,7 +414,7 @@
   '--nodates[omit dates from diff headers]')
 
 _hg_mergetool_opts=(
-  '(--tool -t)'{-t+,--tool}'[specify merge tool]:tool:')
+  '(--tool -t)'{-t+,--tool=}'[specify merge tool]:tool:')
 
 _hg_dryrun_opts=(
   '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
@@ -430,7 +430,7 @@
 
 _hg_log_opts=(
   $_hg_global_opts $_hg_style_opts $_hg_gitlike_opts
-  '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:'
+  '(--limit -l)'{-l+,--limit=}'[limit number of changes displayed]:'
   '(--no-merges -M)'{-M,--no-merges}'[do not show merges]'
   '(--patch -p)'{-p,--patch}'[show patch]'
   '--stat[output diffstat-style summary of changes]'
@@ -438,16 +438,16 @@
 
 _hg_commit_opts=(
   '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
-  '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
-  '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
+  '(-e --edit -l --logfile --message -m)'{-m+,--message=}'[use <text> as commit message]:message:'
+  '(-e --edit -m --message --logfile -l)'{-l+,--logfile=}'[read the commit message from <file>]:log file:_files')
 
 _hg_remote_opts=(
-  '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
+  '(--ssh -e)'{-e+,--ssh=}'[specify ssh command to use]:'
   '--remotecmd[specify hg command to run on the remote side]:')
 
 _hg_branch_bmark_opts=(
-  '(--bookmark -B)'{-B+,--bookmark}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
-  '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches'
+  '(--bookmark -B)'{-B+,--bookmark=}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
+  '(--branch -b)'{-b+,--branch=}'[specify branch(es)]:branch:_hg_branches'
 )
 
 _hg_subrepos_opts=(
@@ -464,13 +464,13 @@
 
 _hg_cmd_addremove() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
-  '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
+  '(--similarity -s)'{-s+,--similarity=}'[guess renamed files by similarity (0<=s<=100)]:' \
   '*:unknown or missing files:_hg_addremove'
 }
 
 _hg_cmd_annotate() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
-  '(--rev -r)'{-r+,--rev}'[annotate the specified revision]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[annotate the specified revision]:revision:_hg_labels' \
   '(--follow -f)'{-f,--follow}'[follow file copies and renames]' \
   '(--text -a)'{-a,--text}'[treat all files as text]' \
   '(--user -u)'{-u,--user}'[list the author]' \
@@ -483,21 +483,21 @@
 _hg_cmd_archive() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '--no-decode[do not pass files through decoders]' \
-  '(--prefix -p)'{-p+,--prefix}'[directory prefix for files in archive]:' \
-  '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_labels' \
-  '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
+  '(--prefix -p)'{-p+,--prefix=}'[directory prefix for files in archive]:' \
+  '(--rev -r)'{-r+,--rev=}'[revision to distribute]:revision:_hg_labels' \
+  '(--type -t)'{-t+,--type=}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
   '*:destination:_files'
 }
 
 _hg_cmd_backout() {
   _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
     '--merge[merge with old dirstate parent after backout]' \
-    '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
+    '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \
     '--parent[parent to choose when backing out merge]' \
-    '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
-    '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
-    '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
-    '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files'
+    '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \
+    '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
+    '(--message -m)'{-m+,--message=}'[use <text> as commit message]:text:' \
+    '(--logfile -l)'{-l+,--logfile=}'[read commit message from <file>]:log file:_files'
 }
 
 _hg_cmd_bisect() {
@@ -507,7 +507,7 @@
   '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_labels \
   '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_labels \
   '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \
-  '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \
+  '(--command -c --noupdate -U)'{-c+,--command=}'[use command to check changeset state]':commands:_command_names \
   '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]'
 }
 
@@ -515,9 +515,9 @@
   _arguments -s -w : $_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)'{-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' \
+  '(--rev -r --delete -d --rename -m)'{-m+,--rename=}'[rename a given bookmark]:bookmark:_hg_bookmarks' \
   ':bookmark:_hg_bookmarks'
 }
 
@@ -537,8 +537,8 @@
   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
   '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_labels' \
-  '(--branch -b)'{-b+,--branch}'[a specific branch to bundle]' \
-  '(--rev -r)'{-r+,--rev}'[changeset(s) to bundle]:' \
+  '(--branch -b)'{-b+,--branch=}'[a specific branch to bundle]:' \
+  '(--rev -r)'{-r+,--rev=}'[changeset(s) to bundle]:' \
   '--all[bundle all changesets in the repository]' \
   ':output file:_files' \
   ':destination repository:_files -/'
@@ -546,17 +546,17 @@
 
 _hg_cmd_cat() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
-  '(--output -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
-  '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
+  '(--output -o)'{-o+,--output=}'[print output to file with formatted name]:filespec:' \
+  '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
   '--decode[apply any matching decode filter]' \
   '*:file:_hg_files'
 }
 
 _hg_cmd_clone() {
   _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
-  '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
-  '(--updaterev -u)'{-u+,--updaterev}'[revision, tag or branch to check out]' \
-  '(--branch -b)'{-b+,--branch}'[clone only the specified branch]' \
+  '(--rev -r)'{-r+,--rev=}'[a changeset you would like to have after cloning]:' \
+  '(--updaterev -u)'{-u+,--updaterev=}'[revision, tag or branch to check out]:' \
+  '(--branch -b)'{-b+,--branch=}'[clone only the specified branch]:' \
   ':source repository:_hg_remote' \
   ':destination:_hg_clone_dest'
 }
@@ -564,10 +564,10 @@
 _hg_cmd_commit() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_subrepos_opts \
   '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
-  '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
-  '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files' \
-  '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
-  '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
+  '(--message -m)'{-m+,--message=}'[use <text> as commit message]:text:' \
+  '(--logfile -l)'{-l+,--logfile=}'[read commit message from <file>]:log file:_files' \
+  '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \
+  '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \
   '--amend[amend the parent of the working dir]' \
   '--close-branch[mark a branch as closed]' \
   '*:file:_hg_files'
@@ -584,12 +584,12 @@
   typeset -A opt_args
   _arguments -s -w : $_hg_global_opts $_hg_diff_opts $_hg_ignore_space_opts \
                      $_hg_pat_opts $_hg_subrepos_opts \
-  '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[revision]:revision:_hg_revrange' \
   '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
-  '(--change -c)'{-c,--change}'[change made by revision]' \
+  '(--change -c)'{-c+,--change=}'[change made by revision]:' \
   '(--text -a)'{-a,--text}'[treat all files as text]' \
   '--reverse[produce a diff that undoes the changes]' \
-  '(--unified -U)'{-U,--unified}'[number of lines of context to show]' \
+  '(--unified -U)'{-U+,--unified=}'[number of lines of context to show]:' \
   '--stat[output diffstat-style summary of changes]' \
   '*:file:->diff_files'
 
@@ -606,9 +606,9 @@
 
 _hg_cmd_export() {
   _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
-  '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
+  '(--outout -o)'{-o+,--output=}'[print output to file with formatted name]:filespec:' \
   '--switch-parent[diff against the second parent]' \
-  '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
   '*:revision:_hg_labels'
 }
 
@@ -634,7 +634,7 @@
   '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
   '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
   '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
-  '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[search in given revision range]:revision:_hg_revrange' \
   '(--user -u)'{-u,--user}'[print user who committed change]' \
   '(--date -d)'{-d,--date}'[print date of a changeset]' \
   '1:search pattern:' \
@@ -645,7 +645,7 @@
   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   '(--topo -t)'{-t,--topo}'[show topological heads only]' \
   '(--closed -c)'{-c,--closed}'[show normal and closed branch heads]' \
-  '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_labels'
+  '(--rev -r)'{-r+,--rev=}'[show only heads which are descendants of rev]:revision:_hg_labels'
 }
 
 _hg_cmd_help() {
@@ -658,25 +658,25 @@
 
 _hg_cmd_identify() {
   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
-  '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \
-  '(--num -n)'{-n+,--num}'[show local revision number]' \
-  '(--id -i)'{-i+,--id}'[show global revision id]' \
-  '(--branch -b)'{-b+,--branch}'[show branch]' \
-  '(--bookmark -B)'{-B+,--bookmark}'[show bookmarks]' \
-  '(--tags -t)'{-t+,--tags}'[show tags]'
+  '(--rev -r)'{-r+,--rev=}'[identify the specified rev]:revision:_hg_labels' \
+  '(--num -n)'{-n,--num}'[show local revision number]' \
+  '(--id -i)'{-i,--id}'[show global revision id]' \
+  '(--branch -b)'{-b,--branch}'[show branch]' \
+  '(--bookmark -B)'{-B,--bookmark}'[show bookmarks]' \
+  '(--tags -t)'{-t,--tags}'[show tags]'
 }
 
 _hg_cmd_import() {
   _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
-  '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
+  '(--strip -p)'{-p+,--strip=}'[directory strip option for patch (default: 1)]:count:' \
   '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
   '--bypass[apply patch without touching the working directory]' \
   '--no-commit[do not commit, just update the working directory]' \
   '--exact[apply patch to the nodes from which it was generated]' \
   '--import-branch[use any branch information in patch (implied by --exact)]' \
-  '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
-  '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
-  '(--similarity -s)'{-s+,--similarity}'[guess renamed files by similarity (0<=s<=100)]:' \
+  '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \
+  '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \
+  '(--similarity -s)'{-s+,--similarity=}'[guess renamed files by similarity (0<=s<=100)]:' \
   '*:patch:_files'
 }
 
@@ -684,7 +684,7 @@
   _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
                      $_hg_subrepos_opts \
   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
-  '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[a specific revision up to which you would like to pull]:revision:_hg_labels' \
   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   '--bundle[file to store the bundles into]:bundle file:_files' \
   ':source:_hg_remote'
@@ -697,7 +697,7 @@
 
 _hg_cmd_locate() {
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
-  '(--rev -r)'{-r+,--rev}'[search repository as it stood at revision]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[search repository as it stood at revision]:revision:_hg_labels' \
   '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \
   '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
   '*:search pattern:_hg_files'
@@ -709,27 +709,27 @@
   '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
   '(--copies -C)'{-C,--copies}'[show copied files]' \
   '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
-  '*'{-r,--rev}'[show the specified revision or revset]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[show the specified revision or revset]:revision:_hg_revrange' \
   '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
-  '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
-  '(--graph -G)'{-G+,--graph}'[show the revision DAG]' \
-  '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
-  '(--user -u)'{-u+,--user}'[revisions committed by user]:user:' \
-  '(--date -d)'{-d+,--date}'[show revisions matching date spec]:date:' \
+  '(--prune -P)'{-P+,--prune=}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
+  '(--graph -G)'{-G,--graph}'[show the revision DAG]' \
+  '(--branch -b)'{-b+,--branch=}'[show changesets within the given named branch]:branch:_hg_branches' \
+  '(--user -u)'{-u+,--user=}'[revisions committed by user]:user:' \
+  '(--date -d)'{-d+,--date=}'[show revisions matching date spec]:date:' \
   '*:files:_hg_files'
 }
 
 _hg_cmd_manifest() {
   _arguments -s -w : $_hg_global_opts \
   '--all[list files from all revisions]' \
-  '(--rev -r)'{-r+,--rev}'[revision to display]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[revision to display]:revision:_hg_labels' \
   ':revision:_hg_labels'
 }
 
 _hg_cmd_merge() {
   _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts \
   '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
-  '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
+  '(--rev -r 1)'{-r+,--rev=}'[revision to merge]:revision:_hg_mergerevs' \
   '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
   ':revision:_hg_mergerevs'
 }
@@ -738,14 +738,14 @@
   _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
                      $_hg_subrepos_opts \
   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
-  '*'{-r,--rev}'[a specific revision you would like to push]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[a specific revision you would like to push]:revision:_hg_revrange' \
   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   ':destination:_hg_remote'
 }
 
 _hg_cmd_parents() {
   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
-  '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[show parents of the specified rev]:revision:_hg_labels' \
   ':last modified file:_hg_files'
 }
 
@@ -760,7 +760,7 @@
   '(--draft -d)'{-d,--draft}'[set changeset phase to draft]' \
   '(--secret -s)'{-s,--secret}'[set changeset phase to secret]' \
   '(--force -f)'{-f,--force}'[allow to move boundary backward]' \
-  '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[target revision]:revision:_hg_labels' \
   ':revision:_hg_labels'
 }
 
@@ -775,7 +775,7 @@
 _hg_cmd_push() {
   _arguments -s -w : $_hg_global_opts $_hg_branch_bmark_opts $_hg_remote_opts \
   '(--force -f)'{-f,--force}'[force push]' \
-  '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[a specific revision you would like to push]:revision:_hg_labels' \
   '--new-branch[allow pushing a new branch]' \
   ':destination:_hg_remote'
 }
@@ -819,9 +819,9 @@
 
   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
   '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
-  '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[revision to revert to]:revision:_hg_labels' \
   '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
-  '(--date -d)'{-d+,--date}'[tipmost revision matching date]:date code:' \
+  '(--date -d)'{-d+,--date=}'[tipmost revision matching date]:date code:' \
   '*:file:->diff_files'
 
   if [[ $state == 'diff_files' ]]
@@ -844,13 +844,13 @@
 
 _hg_cmd_serve() {
   _arguments -s -w : $_hg_global_opts \
-  '(--accesslog -A)'{-A+,--accesslog}'[name of access log file]:log file:_files' \
-  '(--errorlog -E)'{-E+,--errorlog}'[name of error log file]:log file:_files' \
+  '(--accesslog -A)'{-A+,--accesslog=}'[name of access log file]:log file:_files' \
+  '(--errorlog -E)'{-E+,--errorlog=}'[name of error log file]:log file:_files' \
   '(--daemon -d)'{-d,--daemon}'[run server in background]' \
-  '(--port -p)'{-p+,--port}'[listen port]:listen port:' \
-  '(--address -a)'{-a+,--address}'[interface address]:interface address:' \
+  '(--port -p)'{-p+,--port=}'[listen port]:listen port:' \
+  '(--address -a)'{-a+,--address=}'[interface address]:interface address:' \
   '--prefix[prefix path to serve from]:directory:_files' \
-  '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
+  '(--name -n)'{-n+,--name=}'[name to show in web pages]:repository name:' \
   '--web-conf[name of the hgweb config file]:webconf_file:_files' \
   '--pid-file[name of file to write process ID to]:pid_file:_files' \
   '--cmdserver[cmdserver mode]:mode:' \
@@ -863,7 +863,7 @@
 
 _hg_cmd_showconfig() {
   _arguments -s -w : $_hg_global_opts \
-  '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \
+  '(--untrusted -u)'{-u,--untrusted}'[show untrusted configuration options]' \
   ':config item:_hg_config'
 }
 
@@ -893,10 +893,10 @@
 _hg_cmd_tag() {
   _arguments -s -w : $_hg_global_opts \
   '(--local -l)'{-l,--local}'[make the tag local]' \
-  '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \
-  '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
-  '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
-  '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
+  '(--message -m)'{-m+,--message=}'[message for tag commit log entry]:message:' \
+  '(--date -d)'{-d+,--date=}'[record datecode as commit date]:date code:' \
+  '(--user -u)'{-u+,--user=}'[record user as commiter]:user:' \
+  '(--rev -r)'{-r+,--rev=}'[revision to tag]:revision:_hg_labels' \
   '(--force -f)'{-f,--force}'[force tag]' \
   '--remove[remove a tag]' \
   '(--edit -e)'{-e,--edit}'[edit commit message]' \
@@ -917,9 +917,9 @@
 _hg_cmd_update() {
   _arguments -s -w : $_hg_global_opts \
   '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
-  '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
+  '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
   '(--check -c)'{-c,--check}'[update across branches if no uncommitted changes]' \
-  '(--date -d)'{-d+,--date}'[tipmost revision matching date]' \
+  '(--date -d)'{-d+,--date=}'[tipmost revision matching date]:' \
   ':revision:_hg_labels'
 }
 
@@ -928,7 +928,7 @@
 # HGK
 _hg_cmd_view() {
   _arguments -s -w : $_hg_global_opts \
-  '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
+  '(--limit -l)'{-l+,--limit=}'[limit number of changes displayed]:' \
   ':revision range:_hg_labels'
 }
 
@@ -989,7 +989,7 @@
 
 _hg_cmd_qclone() {
   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_clone_opts \
-  '(--patches -p)'{-p+,--patches}'[location of source patch repository]' \
+  '(--patches -p)'{-p+,--patches=}'[location of source patch repository]:' \
   ':source repository:_hg_remote' \
   ':destination:_hg_clone_dest'
 }
@@ -997,7 +997,7 @@
 _hg_cmd_qdelete() {
   _arguments -s -w : $_hg_global_opts \
   '(--keep -k)'{-k,--keep}'[keep patch file]' \
-  '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
+  '*'{-r+,--rev=}'[stop managing a revision]:applied patch:_hg_revrange' \
   '*:unapplied patch:_hg_qdeletable'
 }
 
@@ -1046,7 +1046,7 @@
   '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
   '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
   '(--force -f)'{-f,--force}'[overwrite existing files]' \
-  '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[place existing revisions under mq control]:revision:_hg_revrange' \
   '(--push -P)'{-P,--push}'[qpush after importing]' \
   '*:patch:_files'
 }
@@ -1125,8 +1125,8 @@
   '(--force -f)'{-f,--force}'[force removal, discard uncommitted changes, no backup]' \
   '(--no-backup -n)'{-n,--no-backup}'[no backups]' \
   '(--keep -k)'{-k,--keep}'[do not modify working copy during strip]' \
-  '(--bookmark -B)'{-B+,--bookmark}'[remove revs only reachable from given bookmark]:bookmark:_hg_bookmarks' \
-  '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
+  '(--bookmark -B)'{-B+,--bookmark=}'[remove revs only reachable from given bookmark]:bookmark:_hg_bookmarks' \
+  '(--rev -r)'{-r+,--rev=}'[revision]:revision:_hg_labels' \
   ':revision:_hg_labels'
 }
 
@@ -1138,7 +1138,7 @@
   '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
   '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
   '--bundlename[name of the bundle attachment file (default: bundle)]:' \
-  '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
+  '*'{-r+,--rev=}'[search in given revision range]:revision:_hg_revrange' \
   '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
   '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_labels' \
   '--intro[send an introduction email for a single patch]' \
@@ -1163,10 +1163,10 @@
 # Rebase
 _hg_cmd_rebase() {
   _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_mergetool_opts \
-  '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
-  '(--source -s)'{-s+,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
-  '(--base -b)'{-b+,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
-  '(--dest -d)'{-d+,--dest}'[rebase onto the specified changeset]:revision:_hg_labels' \
+  '*'{-r+,--rev=}'[rebase these revisions]:revision:_hg_revrange' \
+  '(--source -s)'{-s+,--source=}'[rebase from the specified changeset]:revision:_hg_labels' \
+  '(--base -b)'{-b+,--base=}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
+  '(--dest -d)'{-d+,--dest=}'[rebase onto the specified changeset]:revision:_hg_labels' \
   '--collapse[collapse the rebased changeset]' \
   '--keep[keep original changeset]' \
   '--keepbranches[keep original branch name]' \
@@ -1181,8 +1181,8 @@
   '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
   '--close-branch[mark a branch as closed, hiding it from the branch list]' \
   '--amend[amend the parent of the working dir]' \
-  '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:' \
-  '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:'
+  '(--date -d)'{-d+,--date=}'[record the specified date as commit date]:date:' \
+  '(--user -u)'{-u+,--user=}'[record the specified user as committer]:user:'
 }
 
 _hg_cmd_qrecord() {
@@ -1195,8 +1195,8 @@
 _arguments -s -w : $_hg_global_opts \
   '(--source-type -s)'{-s,--source-type}'[source repository type]' \
   '(--dest-type -d)'{-d,--dest-type}'[destination repository type]' \
-  '(--rev -r)'{-r+,--rev}'[import up to target revision]:revision:' \
-  '(--authormap -A)'{-A+,--authormap}'[remap usernames using this file]:file:_files' \
+  '(--rev -r)'{-r+,--rev=}'[import up to target revision]:revision:' \
+  '(--authormap -A)'{-A+,--authormap=}'[remap usernames using this file]:file:_files' \
   '--filemap[remap file names using contents of file]:file:_files' \
   '--splicemap[splice synthesized history into place]:file:_files' \
   '--branchmap[change branch names while converting]:file:_files' \