Mercurial > dotfiles
comparison .zfun/_hg @ 229:e5a40e768cf8
zfun: import newer _hg for improved hg completions
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Sat, 09 Oct 2010 15:21:50 -0500 |
| parents | 0ba810271408 |
| children | c451e42b3ecc |
comparison
equal
deleted
inserted
replaced
| 228:0c8939baa35c | 229:e5a40e768cf8 |
|---|---|
| 2 | 2 |
| 3 # Zsh completion script for mercurial. Rename this file to _hg and copy | 3 # Zsh completion script for mercurial. Rename this file to _hg and copy |
| 4 # it into your zsh function path (/usr/share/zsh/site-functions for | 4 # it into your zsh function path (/usr/share/zsh/site-functions for |
| 5 # instance) | 5 # instance) |
| 6 # | 6 # |
| 7 # Copyright (C) 2005-6 Steve Borho | 7 # If you do not want to install it globally, you can copy it somewhere |
| 8 # Copyright (C) 2006-8 Brendan Cully <brendan@kublai.com> | 8 # else and add that directory to $fpath. This must be done before |
| 9 # compinit is called. If the file is copied to ~/.zsh.d, your ~/.zshrc | |
| 10 # file could look like this: | |
| 9 # | 11 # |
| 10 # This is free software; you can redistribute it and/or modify it under | 12 # fpath=("$HOME/.zsh.d" $fpath) |
| 11 # the terms of the GNU General Public License as published by the Free | 13 # autoload -U compinit |
| 12 # Software Foundation; either version 2 of the License, or (at your | 14 # compinit |
| 13 # option) any later version. | 15 # |
| 16 # Copyright (C) 2005, 2006 Steve Borho <steve@borho.org> | |
| 17 # Copyright (C) 2006-10 Brendan Cully <brendan@kublai.com> | |
| 18 # | |
| 19 # Permission is hereby granted, without written agreement and without | |
| 20 # licence or royalty fees, to use, copy, modify, and distribute this | |
| 21 # software and to distribute modified versions of this software for any | |
| 22 # purpose, provided that the above copyright notice and the following | |
| 23 # two paragraphs appear in all copies of this software. | |
| 24 # | |
| 25 # In no event shall the authors be liable to any party for direct, | |
| 26 # indirect, special, incidental, or consequential damages arising out of | |
| 27 # the use of this software and its documentation, even if the authors | |
| 28 # have been advised of the possibility of such damage. | |
| 29 # | |
| 30 # The authors specifically disclaim any warranties, including, but not | |
| 31 # limited to, the implied warranties of merchantability and fitness for | |
| 32 # a particular purpose. The software provided hereunder is on an "as | |
| 33 # is" basis, and the authors have no obligation to provide maintenance, | |
| 34 # support, updates, enhancements, or modifications. | |
| 14 | 35 |
| 15 emulate -LR zsh | 36 emulate -LR zsh |
| 16 setopt extendedglob | 37 setopt extendedglob |
| 17 | 38 |
| 18 local curcontext="$curcontext" state line | 39 local curcontext="$curcontext" state line |
| 116 _hg_get_commands() { | 137 _hg_get_commands() { |
| 117 typeset -ga _hg_cmd_list | 138 typeset -ga _hg_cmd_list |
| 118 typeset -gA _hg_alias_list | 139 typeset -gA _hg_alias_list |
| 119 local hline cmd cmdalias | 140 local hline cmd cmdalias |
| 120 | 141 |
| 121 _call_program hg hg debugcomplete -v 2>/dev/null | while read -A hline | 142 _call_program hg hg debugcomplete -v | while read -A hline |
| 122 do | 143 do |
| 123 cmd=$hline[1] | 144 cmd=$hline[1] |
| 124 _hg_cmd_list+=($cmd) | 145 _hg_cmd_list+=($cmd) |
| 125 | 146 |
| 126 for cmdalias in $hline[2,-1] | 147 for cmdalias in $hline[2,-1] |
| 143 | 164 |
| 144 _hg_tags() { | 165 _hg_tags() { |
| 145 typeset -a tags | 166 typeset -a tags |
| 146 local tag rev | 167 local tag rev |
| 147 | 168 |
| 148 _hg_cmd tags 2> /dev/null | while read tag | 169 _hg_cmd tags | while read tag |
| 149 do | 170 do |
| 150 tags+=(${tag/ # [0-9]#:*}) | 171 tags+=(${tag/ # [0-9]#:*}) |
| 151 done | 172 done |
| 152 (( $#tags )) && _describe -t tags 'tags' tags | 173 (( $#tags )) && _describe -t tags 'tags' tags |
| 153 } | 174 } |
| 154 | 175 |
| 155 _hg_branches() { | 176 # likely merge candidates |
| 156 typeset -a branches | 177 _hg_mergerevs() { |
| 157 local branch | 178 typeset -a heads |
| 158 | 179 local myrev |
| 159 _hg_cmd branches -a 2> /dev/null | while read branch | 180 |
| 160 do | 181 heads=(${(f)"$(_hg_cmd heads --template '{rev}\\n')"}) |
| 161 branches+=(${branch/ # [0-9]#:*}) | 182 # exclude own revision |
| 162 done | 183 myrev=$(_hg_cmd log -r . --template '{rev}\\n') |
| 163 (( $#branches )) && _describe -t branches 'branches' branches | 184 heads=(${heads:#$myrev}) |
| 164 } | 185 |
| 165 | 186 (( $#heads )) && _describe -t heads 'heads' heads |
| 166 _hg_branchtags() { | |
| 167 typeset -a branchtags | |
| 168 local branch tag | |
| 169 | |
| 170 _hg_cmd tags 2> /dev/null | while read tag | |
| 171 do | |
| 172 branchtags+=(${tag/ # [0-9]#:*}) | |
| 173 done | |
| 174 | |
| 175 _hg_cmd branches -a 2> /dev/null | while read branch | |
| 176 do | |
| 177 branchtags+=(${branch/ # [0-9]#:*}) | |
| 178 done | |
| 179 (( $#branchtags )) && _describe -t branchtags 'branchtags' branchtags | |
| 180 } | 187 } |
| 181 | 188 |
| 182 _hg_files() { | 189 _hg_files() { |
| 183 if [[ -n "$_hg_root" ]] | 190 if [[ -n "$_hg_root" ]] |
| 184 then | 191 then |
| 196 fi | 203 fi |
| 197 } | 204 } |
| 198 | 205 |
| 199 _hg_status() { | 206 _hg_status() { |
| 200 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | 207 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
| 201 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX 2>/dev/null)"}) | 208 status_files=(${(ps:\0:)"$(_hg_cmd status -0n$1 ./$PREFIX)"}) |
| 202 } | 209 } |
| 203 | 210 |
| 204 _hg_unknown() { | 211 _hg_unknown() { |
| 205 typeset -a status_files | 212 typeset -a status_files |
| 206 _hg_status u | 213 _hg_status u |
| 218 _hg_status m | 225 _hg_status m |
| 219 _wanted files expl 'modified files' _multi_parts / status_files | 226 _wanted files expl 'modified files' _multi_parts / status_files |
| 220 } | 227 } |
| 221 | 228 |
| 222 _hg_resolve() { | 229 _hg_resolve() { |
| 223 local rstate rpah | 230 local rstate rpath |
| 224 | 231 |
| 225 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h | 232 [[ -d $PREFIX ]] || PREFIX=$PREFIX:h |
| 226 | 233 |
| 227 _hg_cmd resolve -l ./$PREFIX 2> /dev/null | while read rstate rpath | 234 _hg_cmd resolve -l ./$PREFIX | while read rstate rpath |
| 228 do | 235 do |
| 229 [[ $rstate == 'R' ]] && resolved_files+=($rpath) | 236 [[ $rstate == 'R' ]] && resolved_files+=($rpath) |
| 230 [[ $rstate == 'U' ]] && unresolved_files+=($rpath) | 237 [[ $rstate == 'U' ]] && unresolved_files+=($rpath) |
| 231 done | 238 done |
| 232 } | 239 } |
| 266 local cacheid="hg:${host}-${rempath//\//_}" | 273 local cacheid="hg:${host}-${rempath//\//_}" |
| 267 cacheid=${cacheid%[-_]} | 274 cacheid=${cacheid%[-_]} |
| 268 compset -P '*/' | 275 compset -P '*/' |
| 269 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" | 276 if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" |
| 270 then | 277 then |
| 271 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}" 2> /dev/null)"}##*/}%/}) | 278 remdirs=(${${(M)${(f)"$(_call_program files ssh -a -x $host ls -1FL "${(q)rempath}")"}##*/}%/}) |
| 272 _store_cache "$cacheid" remdirs | 279 _store_cache "$cacheid" remdirs |
| 273 fi | 280 fi |
| 274 _describe -t directories 'remote directory' remdirs -S/ | 281 _describe -t directories 'remote directory' remdirs -S/ |
| 275 else | 282 else |
| 276 _message 'remote directory' | 283 _message 'remote directory' |
| 304 fi | 311 fi |
| 305 } | 312 } |
| 306 | 313 |
| 307 _hg_paths() { | 314 _hg_paths() { |
| 308 typeset -a paths pnames | 315 typeset -a paths pnames |
| 309 _hg_cmd paths 2> /dev/null | while read -A pnames | 316 _hg_cmd paths | while read -A pnames |
| 310 do | 317 do |
| 311 paths+=($pnames[1]) | 318 paths+=($pnames[1]) |
| 312 done | 319 done |
| 313 (( $#paths )) && _describe -t path-aliases 'repository alias' paths | 320 (( $#paths )) && _describe -t path-aliases 'repository alias' paths |
| 314 } | 321 } |
| 349 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') | 356 '*'{-X+,--exclude}'[exclude names matching the given patterns]:dir:_files -W $(_hg_cmd root) -/') |
| 350 | 357 |
| 351 _hg_diff_opts=( | 358 _hg_diff_opts=( |
| 352 '(--text -a)'{-a,--text}'[treat all files as text]' | 359 '(--text -a)'{-a,--text}'[treat all files as text]' |
| 353 '(--git -g)'{-g,--git}'[use git extended diff format]' | 360 '(--git -g)'{-g,--git}'[use git extended diff format]' |
| 354 "--nodates[don't include dates in diff headers]") | 361 "--nodates[omit dates from diff headers]") |
| 355 | 362 |
| 356 _hg_dryrun_opts=( | 363 _hg_dryrun_opts=( |
| 357 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') | 364 '(--dry-run -n)'{-n,--dry-run}'[do not perform actions, just print output]') |
| 358 | 365 |
| 359 _hg_style_opts=( | 366 _hg_style_opts=( |
| 368 _hg_remote_opts=( | 375 _hg_remote_opts=( |
| 369 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' | 376 '(--ssh -e)'{-e+,--ssh}'[specify ssh command to use]:' |
| 370 '--remotecmd[specify hg command to run on the remote side]:') | 377 '--remotecmd[specify hg command to run on the remote side]:') |
| 371 | 378 |
| 372 _hg_cmd() { | 379 _hg_cmd() { |
| 373 _call_program hg hg "$_hg_cmd_globals[@]" "$@" | 380 _call_program hg HGPLAIN=1 hg "$_hg_cmd_globals[@]" "$@" 2> /dev/null |
| 374 } | 381 } |
| 375 | 382 |
| 376 _hg_cmd_add() { | 383 _hg_cmd_add() { |
| 377 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ | 384 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_dryrun_opts \ |
| 378 '*:unknown files:_hg_unknown' | 385 '*:unknown files:_hg_unknown' |
| 412 '--parent[parent to choose when backing out merge]' \ | 419 '--parent[parent to choose when backing out merge]' \ |
| 413 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ | 420 '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ |
| 414 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ | 421 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
| 415 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ | 422 '(--message -m)'{-m+,--message}'[use <text> as commit message]:text:' \ |
| 416 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' | 423 '(--logfile -l)'{-l+,--logfile}'[read commit message from <file>]:log file:_files -g \*.txt' |
| 424 } | |
| 425 | |
| 426 _hg_cmd_bisect() { | |
| 427 _arguments -s -w : $_hg_global_opts \ | |
| 428 '(-)'{-r,--reset}'[reset bisect state]' \ | |
| 429 '(--good -g --bad -b --skip -s --reset -r)'{-g,--good}'[mark changeset good]'::revision:_hg_tags \ | |
| 430 '(--good -g --bad -b --skip -s --reset -r)'{-b,--bad}'[mark changeset bad]'::revision:_hg_tags \ | |
| 431 '(--good -g --bad -b --skip -s --reset -r)'{-s,--skip}'[skip testing changeset]' \ | |
| 432 '(--command -c --noupdate -U)'{-c+,--command}'[use command to check changeset state]':commands:_command_names \ | |
| 433 '(--command -c --noupdate -U)'{-U,--noupdate}'[do not update to target]' | |
| 434 } | |
| 435 | |
| 436 _hg_cmd_branch() { | |
| 437 _arguments -s -w : $_hg_global_opts \ | |
| 438 '(--force -f)'{-f,--force}'[set branch name even if it shadows an existing branch]' \ | |
| 439 '(--clean -C)'{-C,--clean}'[reset branch name to parent branch name]' | |
| 440 } | |
| 441 | |
| 442 _hg_cmd_branches() { | |
| 443 _arguments -s -w : $_hg_global_opts \ | |
| 444 '(--active -a)'{-a,--active}'[show only branches that have unmerge heads]' | |
| 417 } | 445 } |
| 418 | 446 |
| 419 _hg_cmd_bundle() { | 447 _hg_cmd_bundle() { |
| 420 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | 448 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ |
| 421 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ | 449 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \ |
| 569 _arguments -s -w : $_hg_global_opts \ | 597 _arguments -s -w : $_hg_global_opts \ |
| 570 ':revision:_hg_tags' | 598 ':revision:_hg_tags' |
| 571 } | 599 } |
| 572 | 600 |
| 573 _hg_cmd_merge() { | 601 _hg_cmd_merge() { |
| 574 _arguments -s -w : $_hg_global_opts \ | 602 _arguments -s -w : $_hg_global_opts \ |
| 575 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ | 603 '(--force -f)'{-f,--force}'[force a merge with outstanding changes]' \ |
| 576 '(--rev -r)'{-r,--rev}'[revision to merge]:revision:_hg_branches' \ | 604 '(--rev -r 1)'{-r,--rev}'[revision to merge]:revision:_hg_mergerevs' \ |
| 577 ':revision:_hg_branches' | 605 '(--preview -P)'{-P,--preview}'[review revisions to merge (no merge is performed)]' \ |
| 606 ':revision:_hg_mergerevs' | |
| 578 } | 607 } |
| 579 | 608 |
| 580 _hg_cmd_outgoing() { | 609 _hg_cmd_outgoing() { |
| 581 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ | 610 _arguments -s -w : $_hg_global_opts $_hg_remote_opts $_hg_style_opts \ |
| 582 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ | 611 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \ |
| 702 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ | 731 '(--print0 -0)'{-0,--print0}'[end filenames with NUL, for use with xargs]' \ |
| 703 '--rev[show difference from revision]:revision:_hg_tags' \ | 732 '--rev[show difference from revision]:revision:_hg_tags' \ |
| 704 '*:files:_files' | 733 '*:files:_files' |
| 705 } | 734 } |
| 706 | 735 |
| 736 _hg_cmd_summary() { | |
| 737 _arguments -s -w : $_hg_global_opts \ | |
| 738 '--remote[check for push and pull]' | |
| 739 } | |
| 740 | |
| 707 _hg_cmd_tag() { | 741 _hg_cmd_tag() { |
| 708 _arguments -s -w : $_hg_global_opts \ | 742 _arguments -s -w : $_hg_global_opts \ |
| 709 '(--local -l)'{-l,--local}'[make the tag local]' \ | 743 '(--local -l)'{-l,--local}'[make the tag local]' \ |
| 710 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ | 744 '(--message -m)'{-m+,--message}'[message for tag commit log entry]:message:' \ |
| 711 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ | 745 '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ |
| 726 } | 760 } |
| 727 | 761 |
| 728 _hg_cmd_update() { | 762 _hg_cmd_update() { |
| 729 _arguments -s -w : $_hg_global_opts \ | 763 _arguments -s -w : $_hg_global_opts \ |
| 730 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ | 764 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \ |
| 731 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_branchtags' \ | 765 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \ |
| 732 ':revision:_hg_branchtags' | 766 ':revision:_hg_tags' |
| 733 } | 767 } |
| 734 | 768 |
| 735 # bisect extension | 769 ## extensions ## |
| 736 _hg_cmd_bisect() { | 770 |
| 737 _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)' | 771 # bookmarks |
| 772 _hg_bookmarks() { | |
| 773 typeset -a bookmark bookmarks | |
| 774 | |
| 775 _hg_cmd bookmarks | while read -A bookmark | |
| 776 do | |
| 777 if test -z ${bookmark[-1]:#[0-9]*} | |
| 778 then | |
| 779 bookmarks+=($bookmark[-2]) | |
| 780 fi | |
| 781 done | |
| 782 (( $#bookmarks )) && _describe -t bookmarks 'bookmarks' bookmarks | |
| 783 } | |
| 784 | |
| 785 _hg_cmd_bookmarks() { | |
| 786 _arguments -s -w : $_hg_global_opts \ | |
| 787 '(--force -f)'{-f,--force}'[force]' \ | |
| 788 '(--rev -r --delete -d --rename -m)'{-r+,--rev}'[revision]:revision:_hg_tags' \ | |
| 789 '(--rev -r --delete -d --rename -m)'{-d,--delete}'[delete a given bookmark]' \ | |
| 790 '(--rev -r --delete -d --rename -m)'{-m+,--rename}'[rename a given bookmark]:bookmark:_hg_bookmarks' \ | |
| 791 ':bookmark:_hg_bookmarks' | |
| 738 } | 792 } |
| 739 | 793 |
| 740 # HGK | 794 # HGK |
| 741 _hg_cmd_view() { | 795 _hg_cmd_view() { |
| 742 _arguments -s -w : $_hg_global_opts \ | 796 _arguments -s -w : $_hg_global_opts \ |
| 745 } | 799 } |
| 746 | 800 |
| 747 # MQ | 801 # MQ |
| 748 _hg_qseries() { | 802 _hg_qseries() { |
| 749 typeset -a patches | 803 typeset -a patches |
| 750 patches=(${(f)"$(_hg_cmd qseries 2>/dev/null)"}) | 804 patches=(${(f)"$(_hg_cmd qseries)"}) |
| 751 (( $#patches )) && _describe -t hg-patches 'patches' patches | 805 (( $#patches )) && _describe -t hg-patches 'patches' patches |
| 752 } | 806 } |
| 753 | 807 |
| 754 _hg_qapplied() { | 808 _hg_qapplied() { |
| 755 typeset -a patches | 809 typeset -a patches |
| 756 patches=(${(f)"$(_hg_cmd qapplied 2>/dev/null)"}) | 810 patches=(${(f)"$(_hg_cmd qapplied)"}) |
| 757 if (( $#patches )) | 811 if (( $#patches )) |
| 758 then | 812 then |
| 759 patches+=(qbase qtip) | 813 patches+=(qbase qtip) |
| 760 _describe -t hg-applied-patches 'applied patches' patches | 814 _describe -t hg-applied-patches 'applied patches' patches |
| 761 fi | 815 fi |
| 762 } | 816 } |
| 763 | 817 |
| 764 _hg_qunapplied() { | 818 _hg_qunapplied() { |
| 765 typeset -a patches | 819 typeset -a patches |
| 766 patches=(${(f)"$(_hg_cmd qunapplied 2>/dev/null)"}) | 820 patches=(${(f)"$(_hg_cmd qunapplied)"}) |
| 767 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches | 821 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
| 822 } | |
| 823 | |
| 824 # unapplied, including guarded patches | |
| 825 _hg_qdeletable() { | |
| 826 typeset -a unapplied | |
| 827 unapplied=(${(f)"$(_hg_cmd qseries)"}) | |
| 828 for p in $(_hg_cmd qapplied) | |
| 829 do | |
| 830 unapplied=(${unapplied:#$p}) | |
| 831 done | |
| 832 | |
| 833 (( $#unapplied )) && _describe -t hg-allunapplied-patches 'all unapplied patches' unapplied | |
| 768 } | 834 } |
| 769 | 835 |
| 770 _hg_qguards() { | 836 _hg_qguards() { |
| 771 typeset -a guards | 837 typeset -a guards |
| 772 local guard | 838 local guard |
| 773 compset -P "+|-" | 839 compset -P "+|-" |
| 774 _hg_cmd qselect -s 2>/dev/null | while read guard | 840 _hg_cmd qselect -s | while read guard |
| 775 do | 841 do |
| 776 guards+=(${guard#(+|-)}) | 842 guards+=(${guard#(+|-)}) |
| 777 done | 843 done |
| 778 (( $#guards )) && _describe -t hg-guards 'guards' guards | 844 (( $#guards )) && _describe -t hg-guards 'guards' guards |
| 779 } | 845 } |
| 787 | 853 |
| 788 _hg_cmd_qdelete() { | 854 _hg_cmd_qdelete() { |
| 789 _arguments -s -w : $_hg_global_opts \ | 855 _arguments -s -w : $_hg_global_opts \ |
| 790 '(--keep -k)'{-k,--keep}'[keep patch file]' \ | 856 '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
| 791 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ | 857 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_revrange' \ |
| 792 '*:unapplied patch:_hg_qunapplied' | 858 '*:unapplied patch:_hg_qdeletable' |
| 793 } | 859 } |
| 794 | 860 |
| 795 _hg_cmd_qdiff() { | 861 _hg_cmd_qdiff() { |
| 796 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ | 862 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
| 797 '*:pattern:_hg_files' | 863 '*:pattern:_hg_files' |
| 858 '(--all -a :)'{-a,--all}'[apply all patches]' \ | 924 '(--all -a :)'{-a,--all}'[apply all patches]' \ |
| 859 '(--list -l)'{-l,--list}'[list patch name in commit text]' \ | 925 '(--list -l)'{-l,--list}'[list patch name in commit text]' \ |
| 860 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ | 926 '(--merge -m)'{-m+,--merge}'[merge from another queue]:' \ |
| 861 '(--name -n)'{-n+,--name}'[merge queue name]:' \ | 927 '(--name -n)'{-n+,--name}'[merge queue name]:' \ |
| 862 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ | 928 '(--force -f)'{-f,--force}'[apply if the patch has rejects]' \ |
| 929 '--move[reorder patch series and apply only the patch]' \ | |
| 863 ':patch:_hg_qunapplied' | 930 ':patch:_hg_qunapplied' |
| 864 } | 931 } |
| 865 | 932 |
| 866 _hg_cmd_qrefresh() { | 933 _hg_cmd_qrefresh() { |
| 867 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ | 934 _arguments -s -w : $_hg_global_opts $_hg_pat_opts $_hg_commit_opts \ |
| 904 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ | 971 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
| 905 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ | 972 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
| 906 ':revision:_hg_tags' | 973 ':revision:_hg_tags' |
| 907 } | 974 } |
| 908 | 975 |
| 976 # Patchbomb | |
| 977 _hg_cmd_email() { | |
| 978 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \ | |
| 979 '(--git -g)'{-g,--git}'[use git extended diff format]' \ | |
| 980 '--plain[omit hg patch header]' \ | |
| 981 '(--outgoing -o)'{-o,--outgoing}'[send changes not found in the target repository]' \ | |
| 982 '(--bundle -b)'{-b,--bundle}'[send changes not in target as a binary bundle]' \ | |
| 983 '--bundlename[name of the bundle attachment file (default: bundle)]:' \ | |
| 984 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \ | |
| 985 '--force[run even when remote repository is unrelated (with -b/--bundle)]' \ | |
| 986 '*--base[a base changeset to specify instead of a destination (with -b/--bundle)]:revision:_hg_tags' \ | |
| 987 '--intro[send an introduction email for a single patch]' \ | |
| 988 '(--inline -i --attach -a)'{-a,--attach}'[send patches as attachments]' \ | |
| 989 '(--attach -a --inline -i)'{-i,--inline}'[send patches as inline attachments]' \ | |
| 990 '*--bcc[email addresses of blind carbon copy recipients]:email:' \ | |
| 991 '*'{-c+,--cc}'[email addresses of copy recipients]:email:' \ | |
| 992 '(--diffstat -d)'{-d,--diffstat}'[add diffstat output to messages]' \ | |
| 993 '--date[use the given date as the sending date]:date:' \ | |
| 994 '--desc[use the given file as the series description]:files:_files' \ | |
| 995 '(--from -f)'{-f,--from}'[email address of sender]:email:' \ | |
| 996 '(--test -n)'{-n,--test}'[print messages that would be sent]' \ | |
| 997 '(--mbox -m)'{-m,--mbox}'[write messages to mbox file instead of sending them]:file:' \ | |
| 998 '*--reply-to[email addresses replies should be sent to]:email:' \ | |
| 999 '(--subject -s)'{-s,--subject}'[subject of first message (intro or single patch)]:subject:' \ | |
| 1000 '--in-reply-to[message identifier to reply to]:msgid:' \ | |
| 1001 '*--flag[flags to add in subject prefixes]:flag:' \ | |
| 1002 '*'{-t,--to}'[email addresses of recipients]:email:' \ | |
| 1003 ':revision:_hg_revrange' | |
| 1004 } | |
| 1005 | |
| 909 _hg "$@" | 1006 _hg "$@" |
