162 _hg_remote() { |
162 _hg_remote() { |
163 _alternative 'repository aliases:repository aliases:_hg_paths' \ |
163 _alternative 'repository aliases:repository aliases:_hg_paths' \ |
164 'directory:directory:_files -/' |
164 'directory:directory:_files -/' |
165 } |
165 } |
166 |
166 |
167 _hg_qseries() { |
|
168 typeset -a patches |
|
169 patches=($(_hg_cmd qseries)) |
|
170 (( $#patches )) && _describe -t hg-patches 'patches' patches |
|
171 } |
|
172 |
|
173 _hg_qapplied() { |
|
174 typeset -a patches |
|
175 patches=($(_hg_cmd qapplied)) |
|
176 (( $#patches )) && _describe -t hg-applied-patches 'applied patches' patches |
|
177 } |
|
178 |
|
179 _hg_qunapplied() { |
|
180 typeset -a patches |
|
181 patches=($(_hg_cmd qunapplied)) |
|
182 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
|
183 } |
|
184 |
|
185 # Common options |
167 # Common options |
186 _hg_global_opts=( |
168 _hg_global_opts=( |
187 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
169 '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' |
188 '--cwd[change working directory]:new working directory:_files -/' |
170 '--cwd[change working directory]:new working directory:_files -/' |
189 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' |
171 '(--noninteractive -y)'{-y,--noninteractive}'[do not prompt, assume yes for any required answers]' |
514 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
496 '(--limit -l)'{-l+,--limit}'[limit number of changes displayed]:' \ |
515 ':revision range:_hg_tags' |
497 ':revision range:_hg_tags' |
516 } |
498 } |
517 |
499 |
518 # MQ |
500 # MQ |
|
501 _hg_qseries() { |
|
502 typeset -a patches |
|
503 patches=($(_hg_cmd qseries)) |
|
504 (( $#patches )) && _describe -t hg-patches 'patches' patches |
|
505 } |
|
506 |
|
507 _hg_qapplied() { |
|
508 typeset -a patches |
|
509 patches=($(_hg_cmd qapplied)) |
|
510 (( $#patches )) && _describe -t hg-applied-patches 'applied patches' patches |
|
511 } |
|
512 |
|
513 _hg_qunapplied() { |
|
514 typeset -a patches |
|
515 patches=($(_hg_cmd qunapplied)) |
|
516 (( $#patches )) && _describe -t hg-unapplied-patches 'unapplied patches' patches |
|
517 } |
|
518 |
|
519 _hg_qguards() { |
|
520 typeset -a guards |
|
521 local guard |
|
522 _hg_cmd qselect -s | while read guard |
|
523 do |
|
524 guards+=(${guard#(+|-)}) |
|
525 done |
|
526 (( $#guards )) && _describe -t hg-guards 'guards' guards |
|
527 } |
|
528 |
|
529 _hg_qseries_opts=( |
|
530 '(--summary -s)'{-s,--summary}'[print first line of patch header]') |
|
531 |
|
532 _hg_cmd_qapplied() { |
|
533 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
534 } |
|
535 |
519 _hg_cmd_qdelete() { |
536 _hg_cmd_qdelete() { |
520 _arguments -s -w : $_hg_global_opts \ |
537 _arguments -s -w : $_hg_global_opts \ |
521 '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
538 '(--keep -k)'{-k,--keep}'[keep patch file]' \ |
522 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_qapplied' \ |
539 '*'{-r+,--rev}'[stop managing a revision]:applied patch:_hg_qapplied' \ |
523 '*:patch:_hg_qunapplied' |
540 '*:unapplied patch:_hg_qunapplied' |
|
541 } |
|
542 |
|
543 _hg_cmd_qdiff() { |
|
544 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \ |
|
545 '*:pattern:_files -W $(_hg_cmd root)' |
|
546 } |
|
547 |
|
548 _hg_cmd_qfold() { |
|
549 _arguments -s -w : $_hg_global_opts $_h_commit_opts \ |
|
550 '(--keep,-k)'{-k,--keep}'[keep folded patch files]' \ |
|
551 '*:unapplied patch:_hg_qunapplied' |
|
552 } |
|
553 |
|
554 _hg_cmd_qguard() { |
|
555 _arguments -s -w : $_hg_global_opts \ |
|
556 '(--list -l)'{-l,--list}'[list all patches and guards]' \ |
|
557 '(--none -n)'{-n,--none}'[drop all guards]' \ |
|
558 ':patch:_hg_qseries' \ |
|
559 '*:guards:_hg_qguards' |
524 } |
560 } |
525 |
561 |
526 _hg_cmd_qheader() { |
562 _hg_cmd_qheader() { |
527 _arguments -s -w : $_hg_global_opts \ |
563 _arguments -s -w : $_hg_global_opts \ |
528 ':patch:_hg_qseries' |
564 ':patch:_hg_qseries' |
|
565 } |
|
566 |
|
567 _hg_cmd_qimport() { |
|
568 _arguments -s -w : $_hg_global_opts \ |
|
569 '(--existing -e)'{-e,--existing}'[import file in patch dir]' \ |
|
570 '(--name -n 2)'{-n+,--name}'[patch file name]:name:' \ |
|
571 '(--force -f)'{-f,--force}'[overwrite existing files]' \ |
|
572 '*'{-r+,--rev}'[place existing revisions under mq control]:revision:_hg_tags' \ |
|
573 '*:patch:_files' |
529 } |
574 } |
530 |
575 |
531 _hg_cmd_qnew() { |
576 _hg_cmd_qnew() { |
532 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ |
577 _arguments -s -w : $_hg_global_opts $_hg_commit_opts \ |
533 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
578 '(--force -f)'{-f,--force}'[import uncommitted changes into patch]' \ |
534 ':patch:' |
579 ':patch:' |
535 } |
580 } |
536 |
581 |
|
582 _hg_cmd_qnext() { |
|
583 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
584 } |
|
585 |
537 _hg_cmd_qpop() { |
586 _hg_cmd_qpop() { |
538 _arguments -s -w : $_hg_global_opts \ |
587 _arguments -s -w : $_hg_global_opts \ |
539 '(--all -a :)'{-a,--all}'[pop all patches]' \ |
588 '(--all -a :)'{-a,--all}'[pop all patches]' \ |
540 '(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
589 '(--name -n)'{-n+,--name}'[queue name to pop]:' \ |
541 '(--force -f)'{-f,--force}'[forget any local changes]' \ |
590 '(--force -f)'{-f,--force}'[forget any local changes]' \ |
542 ':patch:_hg_qapplied' |
591 ':patch:_hg_qapplied' |
|
592 } |
|
593 |
|
594 _hg_cmd_qprev() { |
|
595 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
543 } |
596 } |
544 |
597 |
545 _hg_cmd_qpush() { |
598 _hg_cmd_qpush() { |
546 _arguments -s -w : $_hg_global_opts \ |
599 _arguments -s -w : $_hg_global_opts \ |
547 '(--all -a :)'{-a,--all}'[apply all patches]' \ |
600 '(--all -a :)'{-a,--all}'[apply all patches]' \ |
557 '(--git -g)'{-g,--git}'[use git extended diff format]' \ |
610 '(--git -g)'{-g,--git}'[use git extended diff format]' \ |
558 '(--short -s)'{-s,--short}'[short refresh]' \ |
611 '(--short -s)'{-s,--short}'[short refresh]' \ |
559 '*:files:_files -W $(_hg_cmd root)' |
612 '*:files:_files -W $(_hg_cmd root)' |
560 } |
613 } |
561 |
614 |
|
615 _hg_cmd_qrename() { |
|
616 _arguments -s -w : $_hg_global_opts \ |
|
617 ':patch:_hg_qseries' \ |
|
618 ':destination:' |
|
619 } |
|
620 |
|
621 _hg_cmd_qselect() { |
|
622 _arguments -s -w : $_hg_global_opts \ |
|
623 '(--none -n :)'{-n,--none}'[disable all guards]' \ |
|
624 '(--series -s :)'{-s,--series}'[list all guards in series file]' \ |
|
625 '--pop[pop to before first guarded applied patch]' \ |
|
626 '--reapply[pop and reapply patches]' \ |
|
627 '*:guards:_hg_qguards' |
|
628 } |
|
629 |
|
630 _hg_cmd_qseries() { |
|
631 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts \ |
|
632 '(--missing -m)'{-m,--missing}'[print patches not in series]' |
|
633 } |
|
634 |
|
635 _hg_cmd_qunapplied() { |
|
636 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
637 } |
|
638 |
|
639 _hg_cmd_qtop() { |
|
640 _arguments -s -w : $_hg_global_opts $_hg_qseries_opts |
|
641 } |
|
642 |
562 _hg_cmd_strip() { |
643 _hg_cmd_strip() { |
563 _arguments -s -w : $_hg_global_opts \ |
644 _arguments -s -w : $_hg_global_opts \ |
564 '(--force -f)'{-f,--force}'[force multi-head removal]' \ |
645 '(--force -f)'{-f,--force}'[force multi-head removal]' \ |
565 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
646 '(--backup -b)'{-b,--backup}'[bundle unrelated changesets]' \ |
566 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |
647 '(--nobackup -n)'{-n,--nobackup}'[no backups]' \ |