contrib/zsh_completion
changeset 17398 b290d3b1c1b8
parent 17397 c785bb3ace29
child 17399 dbff625679a1
equal deleted inserted replaced
17397:c785bb3ace29 17398:b290d3b1c1b8
   396 
   396 
   397 _hg_pat_opts=(
   397 _hg_pat_opts=(
   398   '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
   398   '*'{-I+,--include}'[include names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/'
   399   '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
   399   '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/')
   400 
   400 
       
   401 _hg_clone_opts=(
       
   402   $_hg_remote_opts
       
   403   '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]'
       
   404   '--pull[use pull protocol to copy metadata]'
       
   405   '--uncompressed[use uncompressed transfer (fast over LAN)]')
       
   406 
       
   407 _hg_date_user_opts=(
       
   408   '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]'
       
   409   '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]'
       
   410   '(--date -d)'{-d+,--date}'[record the specified date as commit date]:date:'
       
   411   '(--user -u)'{-u+,--user}'[record the specified user as committer]:user:')
       
   412 
       
   413 _hg_gitlike_opts=(
       
   414   '(--git -g)'{-g,--git}'[use git extended diff format]')
       
   415 
   401 _hg_diff_opts=(
   416 _hg_diff_opts=(
       
   417   $_hg_gitlike_opts
   402   '(--text -a)'{-a,--text}'[treat all files as text]'
   418   '(--text -a)'{-a,--text}'[treat all files as text]'
   403   '(--git -g)'{-g,--git}'[use git extended diff format]'
   419   '--nodates[omit dates from diff headers]')
   404   "--nodates[omit dates from diff headers]")
   420 
       
   421 _hg_mergetool_opts=(
       
   422   '(--tool -t)'{-t+,--tool}'[specify merge tool]:tool:')
   405 
   423 
   406 _hg_dryrun_opts=(
   424 _hg_dryrun_opts=(
   407   '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
   425   '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]')
       
   426 
       
   427 _hg_ignore_space_opts=(
       
   428   '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]'
       
   429   '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]'
       
   430   '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]')
   408 
   431 
   409 _hg_style_opts=(
   432 _hg_style_opts=(
   410   '--style[display using template map file]:'
   433   '--style[display using template map file]:'
   411   '--template[display with template]:')
   434   '--template[display with template]:')
       
   435 
       
   436 _hg_log_opts=(
       
   437   $_hg_global_opts $_hg_style_opts $_hg_gitlike_opts
       
   438   '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:'
       
   439   '(--no-merges -M)'{-M,--no-merges}'[do not show merges]'
       
   440   '(--patch -p)'{-p,--patch}'[show patch]'
       
   441   '--stat[output diffstat-style summary of changes]'
       
   442 )
   412 
   443 
   413 _hg_commit_opts=(
   444 _hg_commit_opts=(
   414   '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
   445   '(-m --message -l --logfile --edit -e)'{-e,--edit}'[edit commit message]'
   415   '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
   446   '(-e --edit -l --logfile --message -m)'{-m+,--message}'[use <text> as commit message]:message:'
   416   '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
   447   '(-e --edit -m --message --logfile -l)'{-l+,--logfile}'[read the commit message from <file>]:log file:_files')
   417 
   448 
   418 _hg_remote_opts=(
   449 _hg_remote_opts=(
   419   '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
   450   '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:'
   420   '--remotecmd[specify hg command to run on the remote side]:')
   451   '--remotecmd[specify hg command to run on the remote side]:')
       
   452 
       
   453 _hg_branch_bmark_opts=(
       
   454   '(--bookmark -B)'{-B+,--bookmark}'[specify bookmark(s)]:bookmark:_hg_bookmarks'
       
   455   '(--branch -b)'{-b+,--branch}'[specify branch(es)]:branch:_hg_branches'
       
   456 )
   421 
   457 
   422 _hg_cmd() {
   458 _hg_cmd() {
   423   _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null
   459   _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null
   424 }
   460 }
   425 
   461 
   454   '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
   490   '(--type -t)'{-t+,--type}'[type of distribution to create]:archive type:(files tar tbz2 tgz uzip zip)' \
   455   '*:destination:_files'
   491   '*:destination:_files'
   456 }
   492 }
   457 
   493 
   458 _hg_cmd_backout() {
   494 _hg_cmd_backout() {
   459   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   495   _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
   460     '--merge[merge with old dirstate parent after backout]' \
   496     '--merge[merge with old dirstate parent after backout]' \
   461     '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
   497     '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
   462     '--parent[parent to choose when backing out merge]' \
   498     '--parent[parent to choose when backing out merge]' \
   463     '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
   499     '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
   464     '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
   500     '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
   510   '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
   546   '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_labels' \
   511   '*:file:_hg_files'
   547   '*:file:_hg_files'
   512 }
   548 }
   513 
   549 
   514 _hg_cmd_clone() {
   550 _hg_cmd_clone() {
   515   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   551   _arguments -s -w : $_hg_global_opts $_hg_clone_opts \
   516   '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
   552   '(--noupdate -U)'{-U,--noupdate}'[do not update the new working directory]' \
   517   '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
   553   '(--rev -r)'{-r+,--rev}'[a changeset you would like to have after cloning]:' \
   518   '--uncompressed[use uncompressed transfer (fast over LAN)]' \
   554   '--uncompressed[use uncompressed transfer (fast over LAN)]' \
   519   ':source repository:_hg_remote' \
   555   ':source repository:_hg_remote' \
   520   ':destination:_hg_clone_dest'
   556   ':destination:_hg_clone_dest'
   538   '*:file:_hg_files'
   574   '*:file:_hg_files'
   539 }
   575 }
   540 
   576 
   541 _hg_cmd_diff() {
   577 _hg_cmd_diff() {
   542   typeset -A opt_args
   578   typeset -A opt_args
   543   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
   579   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
       
   580                      $_hg_diff_opts $_hg_ignore_space_opts \
   544   '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
   581   '*'{-r,--rev}'+[revision]:revision:_hg_revrange' \
   545   '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
   582   '(--show-function -p)'{-p,--show-function}'[show which function each change is in]' \
   546   '(--ignore-all-space -w)'{-w,--ignore-all-space}'[ignore white space when comparing lines]' \
       
   547   '(--ignore-space-change -b)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \
       
   548   '(--ignore-blank-lines -B)'{-B,--ignore-blank-lines}'[ignore changes whose lines are all blank]' \
       
   549   '*:file:->diff_files'
   583   '*:file:->diff_files'
   550 
   584 
   551   if [[ $state == 'diff_files' ]]
   585   if [[ $state == 'diff_files' ]]
   552   then
   586   then
   553     if [[ -n $opt_args[-r] ]]
   587     if [[ -n $opt_args[-r] ]]
   570   _arguments -s -w : $_hg_global_opts \
   604   _arguments -s -w : $_hg_global_opts \
   571   '*:file:_hg_files'
   605   '*:file:_hg_files'
   572 }
   606 }
   573 
   607 
   574 _hg_cmd_graft() {
   608 _hg_cmd_graft() {
   575   _arguments -s -w : $_hg_global_opts \
   609   _arguments -s -w : $_hg_global_opts $_hg_dryrun_opts \
       
   610                      $_hg_date_user_opts $_hg_mergetool_opts \
   576   '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \
   611   '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \
   577   '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
   612   '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
   578   '--log[append graft info to log message]' \
   613   '--log[append graft info to log message]' \
   579   '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]' \
       
   580   '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]' \
       
   581   '(--date -d)'{-d,--date}'[record the specified date as commit date]' \
       
   582   '(--user -u)'{-u,--user}'[record the specified user as committer]' \
       
   583   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
       
   584   '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]' \
       
   585   '*:revision:_hg_labels'
   614   '*:revision:_hg_labels'
   586 }
   615 }
   587 
   616 
   588 _hg_cmd_grep() {
   617 _hg_cmd_grep() {
   589   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   618   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   608   _arguments -s -w : $_hg_global_opts \
   637   _arguments -s -w : $_hg_global_opts \
   609   '*:mercurial help topic:_hg_help_topics'
   638   '*:mercurial help topic:_hg_help_topics'
   610 }
   639 }
   611 
   640 
   612 _hg_cmd_identify() {
   641 _hg_cmd_identify() {
   613   _arguments -s -w : $_hg_global_opts \
   642   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   614   '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \
   643   '(--rev -r)'{-r+,--rev}'[identify the specified rev]:revision:_hg_labels' \
   615   '(--num -n)'{-n+,--num}'[show local revision number]' \
   644   '(--num -n)'{-n+,--num}'[show local revision number]' \
   616   '(--id -i)'{-i+,--id}'[show global revision id]' \
   645   '(--id -i)'{-i+,--id}'[show global revision id]' \
   617   '(--branch -b)'{-b+,--branch}'[show branch]' \
   646   '(--branch -b)'{-b+,--branch}'[show branch]' \
   618   '(--tags -t)'{-t+,--tags}'[show tags]'
   647   '(--tags -t)'{-t+,--tags}'[show tags]'
   619 }
   648 }
   620 
   649 
   621 _hg_cmd_import() {
   650 _hg_cmd_import() {
   622   _arguments -s -w : $_hg_global_opts \
   651   _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
   623   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   652   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   624   '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
       
   625   '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
   653   '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
   626   '--bypass[apply patch without touching the working directory]' \
   654   '--bypass[apply patch without touching the working directory]' \
   627   '*:patch:_files'
   655   '*:patch:_files'
   628 }
   656 }
   629 
   657 
   630 _hg_cmd_incoming() {
   658 _hg_cmd_incoming() {
   631   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   659   _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
   632   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
       
   633   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   660   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   634   '(--patch -p)'{-p,--patch}'[show patch]' \
       
   635   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
   661   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:_hg_tags' \
   636   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   662   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   637   '--bundle[file to store the bundles into]:bundle file:_files' \
   663   '--bundle[file to store the bundles into]:bundle file:_files' \
   638   ':source:_hg_remote'
   664   ':source:_hg_remote'
   639 }
   665 }
   650   '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
   676   '(--fullpath -f)'{-f,--fullpath}'[print complete paths]' \
   651   '*:search pattern:_hg_files'
   677   '*:search pattern:_hg_files'
   652 }
   678 }
   653 
   679 
   654 _hg_cmd_log() {
   680 _hg_cmd_log() {
   655   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_style_opts \
   681   _arguments -s -w : $_hg_log_opts $_hg_pat_opts \
   656   '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \
   682   '(--follow --follow-first -f)'{-f,--follow}'[follow changeset or history]' \
   657   '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
   683   '(-f --follow)--follow-first[only follow the first parent of merge changesets]' \
   658   '(--copies -C)'{-C,--copies}'[show copied files]' \
   684   '(--copies -C)'{-C,--copies}'[show copied files]' \
   659   '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
   685   '(--keyword -k)'{-k+,--keyword}'[search for a keyword]:' \
   660   '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \
       
   661   '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
   686   '*'{-r,--rev}'[show the specified revision or range]:revision:_hg_revrange' \
   662   '(--no-merges -M)'{-M,--no-merges}'[do not show merges]' \
       
   663   '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
   687   '(--only-merges -m)'{-m,--only-merges}'[show only merges]' \
   664   '(--patch -p)'{-p,--patch}'[show patch]' \
       
   665   '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
   688   '(--prune -P)'{-P+,--prune}'[do not display revision or any of its ancestors]:revision:_hg_labels' \
   666   '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
   689   '(--branch -b)'{-b+,--branch}'[show changesets within the given named branch]:branch:_hg_branches' \
   667   '*:files:_hg_files'
   690   '*:files:_hg_files'
   668 }
   691 }
   669 
   692 
   672   '--all[list files from all revisions]' \
   695   '--all[list files from all revisions]' \
   673   ':revision:_hg_labels'
   696   ':revision:_hg_labels'
   674 }
   697 }
   675 
   698 
   676 _hg_cmd_merge() {
   699 _hg_cmd_merge() {
   677   _arguments -s -w : $_hg_global_opts \
   700   _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts \
   678   '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
   701   '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
   679   '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
   702   '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
   680   '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
   703   '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
   681   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
       
   682   ':revision:_hg_mergerevs'
   704   ':revision:_hg_mergerevs'
   683 }
   705 }
   684 
   706 
   685 _hg_cmd_outgoing() {
   707 _hg_cmd_outgoing() {
   686   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   708   _arguments -s -w : $_hg_log_opts $_hg_branch_bmark_opts $_hg_remote_opts \
   687   '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
       
   688   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   709   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   689   '(--patch -p)'{-p,--patch}'[show patch]' \
       
   690   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
   710   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]' \
   691   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   711   '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
   692   ':destination:_hg_remote'
   712   ':destination:_hg_remote'
   693 }
   713 }
   694 
   714 
   712   '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
   732   '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
   713   ':revision:_hg_labels'
   733   ':revision:_hg_labels'
   714 }
   734 }
   715 
   735 
   716 _hg_cmd_pull() {
   736 _hg_cmd_pull() {
   717   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   737   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
   718   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   738   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   719   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
   739   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
   720   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
   740   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
   721   ':source:_hg_remote'
   741   ':source:_hg_remote'
   722 }
   742 }
   723 
   743 
   724 _hg_cmd_push() {
   744 _hg_cmd_push() {
   725   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   745   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_branch_bmark_opts \
   726   '(--force -f)'{-f,--force}'[force push]' \
   746   '(--force -f)'{-f,--force}'[force push]' \
   727   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
   747   '(--rev -r)'{-r+,--rev}'[a specific revision you would like to push]:revision:_hg_labels' \
   728   ':destination:_hg_remote'
   748   ':destination:_hg_remote'
   729 }
   749 }
   730 
   750 
   744 
   764 
   745 _hg_cmd_resolve() {
   765 _hg_cmd_resolve() {
   746   local context state line
   766   local context state line
   747   typeset -A opt_args
   767   typeset -A opt_args
   748 
   768 
   749   _arguments -s -w : $_hg_global_opts \
   769   _arguments -s -w : $_hg_global_opts $_hg_mergetool_opts $_hg_pat_opts \
   750   '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
   770   '(--list -l --mark -m --unmark -u)'{-l,--list}'[list state of files needing merge]:*:merged files:->resolve_files' \
   751   '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
   771   '(--mark -m --list -l --unmark -u)'{-m,--mark}'[mark files as resolved]:*:unresolved files:_hg_unresolved' \
   752   '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
   772   '(--unmark -u --list -l --mark -m)'{-u,--unmark}'[unmark files as resolved]:*:resolved files:_hg_resolved' \
   753   '*:file:_hg_unresolved'
   773   '*:file:_hg_unresolved'
   754 
   774 
   838   '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
   858   '(--rev -r)'{-r+,--rev}'[revision to tag]:revision:_hg_labels' \
   839   ':tag name:'
   859   ':tag name:'
   840 }
   860 }
   841 
   861 
   842 _hg_cmd_tip() {
   862 _hg_cmd_tip() {
   843   _arguments -s -w : $_hg_global_opts $_hg_style_opts \
   863   _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts $_hg_style_opts \
   844   '(--patch -p)'{-p,--patch}'[show patch]'
   864   '(--patch -p)'{-p,--patch}'[show patch]'
   845 }
   865 }
   846 
   866 
   847 _hg_cmd_unbundle() {
   867 _hg_cmd_unbundle() {
   848   _arguments -s -w : $_hg_global_opts \
   868   _arguments -s -w : $_hg_global_opts \
   925   '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
   945   '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \
   926   '*:unapplied patch:_hg_qdeletable'
   946   '*:unapplied patch:_hg_qdeletable'
   927 }
   947 }
   928 
   948 
   929 _hg_cmd_qdiff() {
   949 _hg_cmd_qdiff() {
   930   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   950   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_diff_opts \
       
   951                      $_hg_ignore_space_opts \
   931   '*:pattern:_hg_files'
   952   '*:pattern:_hg_files'
   932 }
   953 }
   933 
   954 
   934 _hg_cmd_qfinish() {
   955 _hg_cmd_qfinish() {
   935   _arguments -s -w : $_hg_global_opts \
   956   _arguments -s -w : $_hg_global_opts \
   961   _arguments -s -w : $_hg_global_opts \
   982   _arguments -s -w : $_hg_global_opts \
   962   ':patch:_hg_qseries'
   983   ':patch:_hg_qseries'
   963 }
   984 }
   964 
   985 
   965 _hg_cmd_qimport() {
   986 _hg_cmd_qimport() {
   966   _arguments -s -w : $_hg_global_opts \
   987   _arguments -s -w : $_hg_global_opts $_hg_gitlike_opts \
   967   '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
   988   '(--existing -e)'{-e,--existing}'[import file in patch dir]' \
   968   '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
   989   '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \
   969   '(--force -f)'{-f,--force}'[overwrite existing files]' \
   990   '(--force -f)'{-f,--force}'[overwrite existing files]' \
   970   '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
   991   '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_revrange' \
   971   '*:patch:_files'
   992   '*:patch:_files'
   972 }
   993 }
   973 
   994 
   974 _hg_cmd_qnew() {
   995 _hg_cmd_qnew() {
   975   _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
   996   _arguments -s -w : $_hg_global_opts $_hg_commit_opts \
       
   997                      $_hg_date_user_opts $_hg_gitlike_opts \
   976   '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \
   998   '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \
   977   ':patch:'
   999   ':patch:'
   978 }
  1000 }
   979 
  1001 
   980 _hg_cmd_qnext() {
  1002 _hg_cmd_qnext() {
  1004   '--move[reorder patch series and apply only the patch]' \
  1026   '--move[reorder patch series and apply only the patch]' \
  1005   ':patch:_hg_qunapplied'
  1027   ':patch:_hg_qunapplied'
  1006 }
  1028 }
  1007 
  1029 
  1008 _hg_cmd_qrefresh() {
  1030 _hg_cmd_qrefresh() {
  1009   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \
  1031   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts $_hg_gitlike_opts \
  1010   '(--git -g)'{-g,--git}'[use git extended diff format]' \
  1032   '(--git -g)'{-g,--git}'[use git extended diff format]' \
  1011   '(--short -s)'{-s,--short}'[short refresh]' \
  1033   '(--short -s)'{-s,--short}'[short refresh]' \
  1012   '*:files:_hg_files'
  1034   '*:files:_hg_files'
  1013 }
  1035 }
  1014 
  1036 
  1048   ':revision:_hg_labels'
  1070   ':revision:_hg_labels'
  1049 }
  1071 }
  1050 
  1072 
  1051 # Patchbomb
  1073 # Patchbomb
  1052 _hg_cmd_email() {
  1074 _hg_cmd_email() {
  1053   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
  1075   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_gitlike_opts \
  1054   '(--git -g)'{-g,--git}'[use git extended diff format]' \
       
  1055   '--plain[omit hg patch header]' \
  1076   '--plain[omit hg patch header]' \
  1056   '--body[send patches as inline message text (default)]' \
  1077   '--body[send patches as inline message text (default)]' \
  1057   '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
  1078   '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
  1058   '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
  1079   '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
  1059   '--bundlename[name of the bundle attachment file (default: bundle)]:' \
  1080   '--bundlename[name of the bundle attachment file (default: bundle)]:' \
  1079   ':revision:_hg_revrange'
  1100   ':revision:_hg_revrange'
  1080 }
  1101 }
  1081 
  1102 
  1082 # Rebase
  1103 # Rebase
  1083 _hg_cmd_rebase() {
  1104 _hg_cmd_rebase() {
  1084   _arguments -s -w : $_hg_global_opts \
  1105   _arguments -s -w : $_hg_global_opts $_hg_commit_opts $_hg_mergetool_opts \
  1085   '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
  1106   '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
  1086   '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
  1107   '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
  1087   '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
  1108   '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
  1088   '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \
  1109   '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \
  1089   '--collapse[collapse the rebased changeset]' \
  1110   '--collapse[collapse the rebased changeset]' \
  1090   '(--message -m)'{-m+,--message}'[use <text> as collapse commit message]:text:' \
       
  1091   '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
       
  1092   '(--logfile -l)'{-l+,--logfile}'[read collapse commit message from <file>]:log file:_files -g \*.txt' \
       
  1093   '--keep[keep original changeset]' \
  1111   '--keep[keep original changeset]' \
  1094   '--keepbranches[keep original branch name]' \
  1112   '--keepbranches[keep original branch name]' \
  1095   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
       
  1096   '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \
  1113   '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \
  1097   '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \
  1114   '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \
  1098 }
  1115 }
  1099 
  1116 
  1100 _hg "$@"
  1117 _hg "$@"