##// 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 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 210 _hg_addremove() {
204 211 _alternative 'files:unknown files:_hg_unknown' \
205 212 'files:missing files:_hg_missing'
@@ -352,6 +359,17 b' typeset -A _hg_cmd_globals'
352 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 373 _hg_cmd_bundle() {
356 374 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
357 375 '(--force -f)'{-f,--force}'[run even when remote repository is unrelated]' \
@@ -431,7 +449,8 b' typeset -A _hg_cmd_globals'
431 449 '(--line-number -n)'{-n,--line-number}'[print matching line numbers]' \
432 450 '*'{-r+,--rev}'[search in given revision range]:revision:_hg_revrange' \
433 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 456 _hg_cmd_heads() {
@@ -444,6 +463,15 b' typeset -A _hg_cmd_globals'
444 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 475 _hg_cmd_import() {
448 476 _arguments -s -w : $_hg_global_opts \
449 477 '(--strip -p)'{-p+,--strip}'[directory strip option for patch (default: 1)]:count:' \
@@ -457,7 +485,7 b' typeset -A _hg_cmd_globals'
457 485 '(--no-merges -M)'{-M,--no-merges}'[do not show merge revisions]' \
458 486 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
459 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 489 '(--newest-first -n)'{-n,--newest-first}'[show newest record first]' \
462 490 '--bundle[file to store the bundles into]:bundle file:_files' \
463 491 ':source:_hg_remote'
@@ -509,7 +537,7 b' typeset -A _hg_cmd_globals'
509 537 _hg_cmd_parents() {
510 538 _arguments -s -w : $_hg_global_opts $_hg_style_opts \
511 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 543 _hg_cmd_paths() {
@@ -521,13 +549,14 b' typeset -A _hg_cmd_globals'
521 549 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
522 550 '(--force -f)'{-f,--force}'[run even when the remote repository is unrelated]' \
523 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 553 ':source:_hg_remote'
525 554 }
526 555
527 556 _hg_cmd_push() {
528 557 _arguments -s -w : $_hg_global_opts $_hg_remote_opts \
529 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 560 ':destination:_hg_remote'
532 561 }
533 562
@@ -579,6 +608,12 b' typeset -A _hg_cmd_globals'
579 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 617 _hg_cmd_status() {
583 618 _arguments -s -w : $_hg_global_opts $_hg_pat_opts \
584 619 '(--all -A)'{-A,--all}'[show status of all files]' \
@@ -620,9 +655,15 b' typeset -A _hg_cmd_globals'
620 655 _hg_cmd_update() {
621 656 _arguments -s -w : $_hg_global_opts \
622 657 '(--clean -C)'{-C,--clean}'[overwrite locally modified files]' \
658 '(--rev -r)'{-r+,--rev}'[revision]:revision:_hg_tags' \
623 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 667 # HGK
627 668 _hg_cmd_view() {
628 669 _arguments -s -w : $_hg_global_opts \
General Comments 0
You need to be logged in to leave comments. Login now