##// END OF EJS Templates
Updated zsh completion from issue722.
Brendan Cully -
r5309:e21644bb default
parent child Browse files
Show More
@@ -200,6 +200,13 b' typeset -A _hg_cmd_globals'
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'
@@ -352,6 +359,17 b' typeset -A _hg_cmd_globals'
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]' \
@@ -431,7 +449,8 b' typeset -A _hg_cmd_globals'
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() {
@@ -444,6 +463,15 b' typeset -A _hg_cmd_globals'
444 '*:mercurial command:_hg_commands'
463 '*:mercurial command:_hg_commands'
445 }
464 }
446
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]'
473 }
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:' \
@@ -457,7 +485,7 b' typeset -A _hg_cmd_globals'
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'
@@ -509,7 +537,7 b' typeset -A _hg_cmd_globals'
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() {
@@ -521,13 +549,14 b' typeset -A _hg_cmd_globals'
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
@@ -579,6 +608,12 b' typeset -A _hg_cmd_globals'
579 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
608 '(--ipv6 -6)'{-6,--ipv6}'[use IPv6 in addition to IPv4]'
580 }
609 }
581
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'
615 }
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]' \
@@ -620,9 +655,15 b' typeset -A _hg_cmd_globals'
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'
624 }
660 }
625
661
662 # bisect extension
663 _hg_cmd_bisect() {
664 _arguments -s -w : $_hg_global_opts ':evaluation:(help init reset next good bad)'
665 }
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 \
General Comments 0
You need to be logged in to leave comments. Login now