contrib/zsh_completion
changeset 17004 a1d86396d8c1
parent 16330 a5a3af000e0d
child 17396 aaaeea31482a
equal deleted inserted replaced
17003:42c472877825 17004:a1d86396d8c1
   512   '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
   512   '(--addremove -A)'{-A,--addremove}'[mark new/missing files as added/removed before committing]' \
   513   '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
   513   '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
   514   '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \
   514   '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' \
   515   '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
   515   '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \
   516   '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
   516   '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \
       
   517   '--amend[amend the parent of the working dir]' \
   517   '*:file:_hg_files'
   518   '*:file:_hg_files'
   518 }
   519 }
   519 
   520 
   520 _hg_cmd_copy() {
   521 _hg_cmd_copy() {
   521   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
   522   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
   547 
   548 
   548 _hg_cmd_export() {
   549 _hg_cmd_export() {
   549   _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
   550   _arguments -s -w : $_hg_global_opts $_hg_diff_opts \
   550   '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
   551   '(--outout -o)'{-o+,--output}'[print output to file with formatted name]:filespec:' \
   551   '--switch-parent[diff against the second parent]' \
   552   '--switch-parent[diff against the second parent]' \
       
   553   '*:revision:_hg_labels'
       
   554 }
       
   555 
       
   556 _hg_cmd_graft() {
       
   557   _arguments -s -w : $_hg_global_opts \
       
   558   '(--continue -c)'{-c,--continue}'[resume interrupted graft]' \
       
   559   '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
       
   560   '--log[append graft info to log message]' \
       
   561   '(--currentdate -D)'{-D,--currentdate}'[record the current date as commit date]' \
       
   562   '(--currentuser -U)'{-U,--currentuser}'[record the current user as committer]' \
       
   563   '(--date -d)'{-d,--date}'[record the specified date as commit date]' \
       
   564   '(--user -u)'{-u,--user}'[record the specified user as committer]' \
       
   565   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
       
   566   '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]' \
   552   '*:revision:_hg_labels'
   567   '*:revision:_hg_labels'
   553 }
   568 }
   554 
   569 
   555 _hg_cmd_grep() {
   570 _hg_cmd_grep() {
   556   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   571   _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
   588 _hg_cmd_import() {
   603 _hg_cmd_import() {
   589   _arguments -s -w : $_hg_global_opts \
   604   _arguments -s -w : $_hg_global_opts \
   590   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   605   '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
   591   '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
   606   '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \
   592   '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
   607   '(--force -f)'{-f,--force}'[skip check for outstanding uncommitted changes]' \
       
   608   '--bypass[apply patch without touching the working directory]' \
   593   '*:patch:_files'
   609   '*:patch:_files'
   594 }
   610 }
   595 
   611 
   596 _hg_cmd_incoming() {
   612 _hg_cmd_incoming() {
   597   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   613   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   633   '*:files:_hg_files'
   649   '*:files:_hg_files'
   634 }
   650 }
   635 
   651 
   636 _hg_cmd_manifest() {
   652 _hg_cmd_manifest() {
   637   _arguments -s -w : $_hg_global_opts \
   653   _arguments -s -w : $_hg_global_opts \
       
   654   '--all[list files from all revisions]' \
   638   ':revision:_hg_labels'
   655   ':revision:_hg_labels'
   639 }
   656 }
   640 
   657 
   641 _hg_cmd_merge() {
   658 _hg_cmd_merge() {
   642   _arguments -s -w : $_hg_global_opts \
   659   _arguments -s -w : $_hg_global_opts \
   643   '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
   660   '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \
   644   '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
   661   '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \
   645   '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
   662   '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \
       
   663   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
   646   ':revision:_hg_mergerevs'
   664   ':revision:_hg_mergerevs'
   647 }
   665 }
   648 
   666 
   649 _hg_cmd_outgoing() {
   667 _hg_cmd_outgoing() {
   650   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   668   _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \
   665 _hg_cmd_paths() {
   683 _hg_cmd_paths() {
   666   _arguments -s -w : $_hg_global_opts \
   684   _arguments -s -w : $_hg_global_opts \
   667   ':path:_hg_paths'
   685   ':path:_hg_paths'
   668 }
   686 }
   669 
   687 
       
   688 _hg_cmd_phase() {
       
   689   _arguments -s -w : $_hg_global_opts \
       
   690   '(--public -p)'{-p,--public}'[set changeset phase to public]' \
       
   691   '(--draft -d)'{-d,--draft}'[set changeset phase to draft]' \
       
   692   '(--secret -s)'{-s,--secret}'[set changeset phase to secret]' \
       
   693   '(--force -f)'{-f,--force}'[allow to move boundary backward]' \
       
   694   '(--rev -r)'{-r+,--rev}'[target revision]:revision:_hg_labels' \
       
   695   ':revision:_hg_labels'
       
   696 }
       
   697 
   670 _hg_cmd_pull() {
   698 _hg_cmd_pull() {
   671   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   699   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
   672   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   700   '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
   673   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
   701   '(--update -u)'{-u,--update}'[update to new tip if changesets were pulled]' \
   674   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
   702   '(--rev -r)'{-r+,--rev}'[a specific revision up to which you would like to pull]:revision:' \
   718   typeset -A opt_args
   746   typeset -A opt_args
   719 
   747 
   720   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
   748   _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \
   721   '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
   749   '(--all -a :)'{-a,--all}'[revert all changes when no arguments given]' \
   722   '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
   750   '(--rev -r)'{-r+,--rev}'[revision to revert to]:revision:_hg_labels' \
   723   '--no-backup[do not save backup copies of files]' \
   751   '(--no-backup -C)'{-C,--no-backup}'[do not save backup copies of files]' \
   724   '*:file:->diff_files'
   752   '*:file:->diff_files'
   725 
   753 
   726   if [[ $state == 'diff_files' ]]
   754   if [[ $state == 'diff_files' ]]
   727   then
   755   then
   728     if [[ -n $opt_args[-r] ]]
   756     if [[ -n $opt_args[-r] ]]
   947   '(--all -a :)'{-a,--all}'[apply all patches]' \
   975   '(--all -a :)'{-a,--all}'[apply all patches]' \
   948   '(--list -l)'{-l,--list}'[list patch name in commit text]' \
   976   '(--list -l)'{-l,--list}'[list patch name in commit text]' \
   949   '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
   977   '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \
   950   '(--name -n)'{-n+,--name}'[merge queue name]:' \
   978   '(--name -n)'{-n+,--name}'[merge queue name]:' \
   951   '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
   979   '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \
       
   980   '(--exact -e)'{-e,--exact}'[apply the target patch to its recorded parent]' \
   952   '--move[reorder patch series and apply only the patch]' \
   981   '--move[reorder patch series and apply only the patch]' \
   953   ':patch:_hg_qunapplied'
   982   ':patch:_hg_qunapplied'
   954 }
   983 }
   955 
   984 
   956 _hg_cmd_qrefresh() {
   985 _hg_cmd_qrefresh() {
   999 # Patchbomb
  1028 # Patchbomb
  1000 _hg_cmd_email() {
  1029 _hg_cmd_email() {
  1001   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
  1030   _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
  1002   '(--git -g)'{-g,--git}'[use git extended diff format]' \
  1031   '(--git -g)'{-g,--git}'[use git extended diff format]' \
  1003   '--plain[omit hg patch header]' \
  1032   '--plain[omit hg patch header]' \
       
  1033   '--body[send patches as inline message text (default)]' \
  1004   '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
  1034   '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \
  1005   '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
  1035   '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \
  1006   '--bundlename[name of the bundle attachment file (default: bundle)]:' \
  1036   '--bundlename[name of the bundle attachment file (default: bundle)]:' \
  1007   '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
  1037   '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
  1008   '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
  1038   '--force[run even when remote repository is unrelated (with -b/--bundle)]' \
  1024   '*--flag[flags to add in subject prefixes]:flag:' \
  1054   '*--flag[flags to add in subject prefixes]:flag:' \
  1025   '*'{-t,--to}'[email addresses of recipients]:email:' \
  1055   '*'{-t,--to}'[email addresses of recipients]:email:' \
  1026   ':revision:_hg_revrange'
  1056   ':revision:_hg_revrange'
  1027 }
  1057 }
  1028 
  1058 
       
  1059 # Rebase
       
  1060 _hg_cmd_rebase() {
       
  1061   _arguments -s -w : $_hg_global_opts \
       
  1062   '*'{-r,--rev}'[rebase these revisions]:revision:_hg_revrange' \
       
  1063   '(--source -s)'{-s,--source}'[rebase from the specified changeset]:revision:_hg_labels' \
       
  1064   '(--base -b)'{-b,--base}'[rebase from the base of the specified changeset]:revision:_hg_labels' \
       
  1065   '(--dest -d)'{-d,--dest}'[rebase onto the specified changeset]' \
       
  1066   '--collapse[collapse the rebased changeset]' \
       
  1067   '(--message -m)'{-m+,--message}'[use <text> as collapse commit message]:text:' \
       
  1068   '(--edit -e)'{-e,--edit}'[invoke editor on commit messages]' \
       
  1069   '(--logfile -l)'{-l+,--logfile}'[read collapse commit message from <file>]:log file:_files -g \*.txt' \
       
  1070   '--keep[keep original changeset]' \
       
  1071   '--keepbranches[keep original branch name]' \
       
  1072   '(--tool -t)'{-t,--tool}'[specify merge tool]' \
       
  1073   '(--continue -c)'{-c,--continue}'[continue an interrupted rebase]' \
       
  1074   '(--abort -a)'{-a,--abort}'[abort an interrupted rebase]' \
       
  1075 }
       
  1076 
  1029 _hg "$@"
  1077 _hg "$@"