Mercurial > hg-stable
changeset 5309:e21644bbf01e
Updated zsh completion from issue722.
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Fri, 14 Sep 2007 21:47:40 -0700 |
parents | 9400d677efc7 |
children | ba3dc7883968 |
files | contrib/zsh_completion |
diffstat | 1 files changed, 45 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/zsh_completion Fri Sep 14 23:10:41 2007 +0200 +++ b/contrib/zsh_completion Fri Sep 14 21:47:40 2007 -0700 @@ -200,6 +200,13 @@ _wanted files expl 'modified files' _multi_parts / status_files } +_hg_config() { + typeset -a items + local line + items=(${${(%f)"$(_hg_cmd showconfig)"}%%\=*}) + (( $#items )) && _describe -t config 'config item' items +} + _hg_addremove() { _alternative 'files:unknown files:_hg_unknown' \ 'files:missing files:_hg_missing' @@ -352,6 +359,17 @@ '*:destination:_files' } +_hg_cmd_backout() { + _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ + '--merge[merge with old dirstate parent after backout]' \ + '(--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_tags' \ + '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ + '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' +} + _hg_cmd_bundle() { _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ @@ -431,7 +449,8 @@ '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \ '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ '(--user -u)'{-u,--user}'[print user who committed change]' \ - '*:search pattern:_hg_files' + '1:search pattern:' \ + '*:files:_hg_files' } _hg_cmd_heads() { @@ -444,6 +463,15 @@ '*:mercurial command:_hg_commands' } +_hg_cmd_identify() { + _arguments -s -w : $_hg_global_opts \ + '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \ + '(--num -n)'{-n+,--num}'[show local revision number]' \ + '(--id -i)'{-i+,--id}'[show global revision id]' \ + '(--branch -b)'{-b+,--branch}'[show branch]' \ + '(--tags -t)'{-t+,--tags}'[show tags]' +} + _hg_cmd_import() { _arguments -s -w : $_hg_global_opts \ '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \ @@ -457,7 +485,7 @@ '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \ '(--patch -p)'{-p,--patch}'[show patch]' \ - '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \ '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \ '--bundle[file to store the bundles into]:bundle file:_files' \ ':source:_hg_remote' @@ -509,7 +537,7 @@ _hg_cmd_parents() { _arguments -s -w : $_hg_global_opts $_hg_style_opts \ '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \ - ':revision:_hg_tags' + ':last modified file:_hg_files' } _hg_cmd_paths() { @@ -521,13 +549,14 @@ _arguments -s -w : $_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 tip if changesets were pulled]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \ ':source:_hg_remote' } _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]' \ + '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \ ':destination:_hg_remote' } @@ -579,6 +608,12 @@ '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]' } +_hg_cmd_showconfig() { + _arguments -s -w : $_hg_global_opts \ + '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \ + ':config item:_hg_config' +} + _hg_cmd_status() { _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ '(--all -A)'{-A,--all}'[show status of all files]' \ @@ -620,9 +655,15 @@ _hg_cmd_update() { _arguments -s -w : $_hg_global_opts \ '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ + '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ ':revision:_hg_tags' } +# bisect extension +_hg_cmd_bisect() { + _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)' +} + # HGK _hg_cmd_view() { _arguments -s -w : $_hg_global_opts \