contrib/zsh_completion
changeset 5309 e21644bbf01e
parent 4448 2d3379c598c1
equal deleted inserted replaced
5308:9400d677efc7 5309:e21644bbf01e
   198   typeset -a status_files
   198   typeset -a status_files
   199   _hg_status m
   199   _hg_status m
   200   _wanted files expl 'modified files' _multi_parts / status_files
   200   _wanted files expl 'modified files' _multi_parts / status_files
   201 }
   201 }
   202 
   202 
       
   203 _hg_config() {
       
   204     typeset -a items
       
   205     local line
       
   206     items=(${${(%f)"$(_hg_cmd showconfig)"}%%\=*})
       
   207     (( $#items )) && _describe -t config 'config item' items
       
   208 }
       
   209 
   203 _hg_addremove() {
   210 _hg_addremove() {
   204   _alternative 'files:unknown files:_hg_unknown' \
   211   _alternative 'files:unknown files:_hg_unknown' \
   205     'files:missing files:_hg_missing'
   212     'files:missing files:_hg_missing'
   206 }
   213 }
   207 
   214 
   350   '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \
   357   '(--rev -r)'{-r+,--rev}'[revision to distribute]:revision:_hg_tags' \
   351   '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
   358   '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
   352   '*:destination:_files'
   359   '*:destination:_files'
   353 }
   360 }
   354 
   361 
       
   362 _hg_cmd_backout() {
       
   363   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
       
   364     '--merge[merge with old dirstate parent after backout]' \
       
   365     '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
       
   366     '--parent[parent to choose when backing out merge]' \
       
   367     '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
       
   368     '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
       
   369     '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
       
   370     '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt'
       
   371 }
       
   372 
   355 _hg_cmd_bundle() {
   373 _hg_cmd_bundle() {
   356   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   374   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   357   '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
   375   '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
   358   '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \
   376   '(2)*--base[a base changeset to specify instead of a destination]:revision:_hg_tags' \
   359   ':output file:_files' \
   377   ':output file:_files' \
   429   '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
   447   '(--ignore-case -i)'{-i,--ignore-case}'[ignore case when matching]' \
   430   '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
   448   '(--files-with-matches -l)'{-l,--files-with-matches}'[print only filenames and revs that match]' \
   431   '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
   449   '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
   432   '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
   450   '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
   433   '(--user -u)'{-u,--user}'[print user who committed change]' \
   451   '(--user -u)'{-u,--user}'[print user who committed change]' \
   434   '*:search pattern:_hg_files'
   452   '1:search pattern:' \
       
   453   '*:files:_hg_files'
   435 }
   454 }
   436 
   455 
   437 _hg_cmd_heads() {
   456 _hg_cmd_heads() {
   438   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   457   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   439   '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags'
   458   '(--rev -r)'{-r+,--rev}'[show only heads which are descendants of rev]:revision:_hg_tags'
   440 }
   459 }
   441 
   460 
   442 _hg_cmd_help() {
   461 _hg_cmd_help() {
   443   _arguments -s -w : $_hg_global_opts \
   462   _arguments -s -w : $_hg_global_opts \
   444   '*:mercurial command:_hg_commands'
   463   '*:mercurial command:_hg_commands'
       
   464 }
       
   465 
       
   466 _hg_cmd_identify() {
       
   467   _arguments -s -w : $_hg_global_opts \
       
   468   '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_tags' \
       
   469   '(--num -n)'{-n+,--num}'[show local revision number]' \
       
   470   '(--id -i)'{-i+,--id}'[show global revision id]' \
       
   471   '(--branch -b)'{-b+,--branch}'[show branch]' \
       
   472   '(--tags -t)'{-t+,--tags}'[show tags]'
   445 }
   473 }
   446 
   474 
   447 _hg_cmd_import() {
   475 _hg_cmd_import() {
   448   _arguments -s -w : $_hg_global_opts \
   476   _arguments -s -w : $_hg_global_opts \
   449   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   477   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   455 _hg_cmd_incoming() {
   483 _hg_cmd_incoming() {
   456   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   484   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   457   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
   485   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
   458   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   486   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   459   '(--patch -p)'{-p,--patch}'[show patch]' \
   487   '(--patch -p)'{-p,--patch}'[show patch]' \
   460   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]' \
   488   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
   461   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   489   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   462   '--bundle[file to store the bundles into]:bundle file:_files' \
   490   '--bundle[file to store the bundles into]:bundle file:_files' \
   463   ':source:_hg_remote'
   491   ':source:_hg_remote'
   464 }
   492 }
   465 
   493 
   507 }
   535 }
   508 
   536 
   509 _hg_cmd_parents() {
   537 _hg_cmd_parents() {
   510   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   538   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   511   '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \
   539   '(--rev -r)'{-r+,--rev}'[show parents of the specified rev]:revision:_hg_tags' \
   512   ':revision:_hg_tags'
   540   ':last modified file:_hg_files'
   513 }
   541 }
   514 
   542 
   515 _hg_cmd_paths() {
   543 _hg_cmd_paths() {
   516   _arguments -s -w : $_hg_global_opts \
   544   _arguments -s -w : $_hg_global_opts \
   517   ':path:_hg_paths'
   545   ':path:_hg_paths'
   519 
   547 
   520 _hg_cmd_pull() {
   548 _hg_cmd_pull() {
   521   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   549   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   522   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   550   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   523   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
   551   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
       
   552   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
   524   ':source:_hg_remote'
   553   ':source:_hg_remote'
   525 }
   554 }
   526 
   555 
   527 _hg_cmd_push() {
   556 _hg_cmd_push() {
   528   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   557   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   529   '(--force -f)'{-f,--force}'[force push]' \
   558   '(--force -f)'{-f,--force}'[force push]' \
   530   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
   559   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_tags' \
   531   ':destination:_hg_remote'
   560   ':destination:_hg_remote'
   532 }
   561 }
   533 
   562 
   534 _hg_cmd_remove() {
   563 _hg_cmd_remove() {
   535   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   564   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   575   '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
   604   '(--name -n)'{-n+,--name}'[name to show in web pages]:repository name:' \
   576   '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
   605   '(--templates -t)'{-t,--templates}'[web template directory]:template dir:_files -/' \
   577   '--style[web template style]:style' \
   606   '--style[web template style]:style' \
   578   '--stdio[for remote clients]' \
   607   '--stdio[for remote clients]' \
   579   '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
   608   '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
       
   609 }
       
   610 
       
   611 _hg_cmd_showconfig() {
       
   612   _arguments -s -w : $_hg_global_opts \
       
   613   '(--untrusted -u)'{-u+,--untrusted}'[show untrusted configuration options]' \
       
   614   ':config item:_hg_config'
   580 }
   615 }
   581 
   616 
   582 _hg_cmd_status() {
   617 _hg_cmd_status() {
   583   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   618   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   584   '(--all -A)'{-A,--all}'[show status of all files]' \
   619   '(--all -A)'{-A,--all}'[show status of all files]' \
   618 }
   653 }
   619 
   654 
   620 _hg_cmd_update() {
   655 _hg_cmd_update() {
   621   _arguments -s -w : $_hg_global_opts \
   656   _arguments -s -w : $_hg_global_opts \
   622   '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
   657   '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
       
   658   '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
   623   ':revision:_hg_tags'
   659   ':revision:_hg_tags'
       
   660 }
       
   661 
       
   662 # bisect extension
       
   663 _hg_cmd_bisect() {
       
   664   _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)'
   624 }
   665 }
   625 
   666 
   626 # HGK
   667 # HGK
   627 _hg_cmd_view() {
   668 _hg_cmd_view() {
   628   _arguments -s -w : $_hg_global_opts \
   669   _arguments -s -w : $_hg_global_opts \