Mercurial > public > mercurial-scm > hg-stable
comparison hgext/githelp.py @ 38162:c65931d23baf
githelp: do not concatenate i18n messages dynamically so they can be collected
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 22 May 2018 20:43:42 +0900 |
parents | 26b73fad45d9 |
children | a40cc6d7d8c3 |
comparison
equal
deleted
inserted
replaced
38161:1cba497491be | 38162:c65931d23baf |
---|---|
393 if len(args) > 1: | 393 if len(args) > 1: |
394 cmd.append(args[1]) | 394 cmd.append(args[1]) |
395 | 395 |
396 if opts.get('bare'): | 396 if opts.get('bare'): |
397 cmd['-U'] = None | 397 cmd['-U'] = None |
398 ui.status(_("note: Mercurial does not have bare clones. " + | 398 ui.status(_("note: Mercurial does not have bare clones. " |
399 "-U will clone the repo without checking out a commit\n\n")) | 399 "-U will clone the repo without checking out a commit\n\n")) |
400 elif opts.get('no_checkout'): | 400 elif opts.get('no_checkout'): |
401 cmd['-U'] = None | 401 cmd['-U'] = None |
402 | 402 |
403 if opts.get('branch'): | 403 if opts.get('branch'): |
404 cocmd = Command("update") | 404 cocmd = Command("update") |
436 | 436 |
437 if opts.get('message'): | 437 if opts.get('message'): |
438 cmd['-m'] = "'%s'" % (opts.get('message'),) | 438 cmd['-m'] = "'%s'" % (opts.get('message'),) |
439 | 439 |
440 if opts.get('all'): | 440 if opts.get('all'): |
441 ui.status(_("note: Mercurial doesn't have a staging area, " + | 441 ui.status(_("note: Mercurial doesn't have a staging area, " |
442 "so there is no --all. -A will add and remove files " + | 442 "so there is no --all. -A will add and remove files " |
443 "for you though.\n\n")) | 443 "for you though.\n\n")) |
444 | 444 |
445 if opts.get('file'): | 445 if opts.get('file'): |
446 cmd['-l'] = opts.get('file') | 446 cmd['-l'] = opts.get('file') |
447 | 447 |
448 if opts.get('author'): | 448 if opts.get('author'): |
454 cmd.extend(args) | 454 cmd.extend(args) |
455 | 455 |
456 ui.status((bytes(cmd)), "\n") | 456 ui.status((bytes(cmd)), "\n") |
457 | 457 |
458 def deprecated(ui, repo, *args, **kwargs): | 458 def deprecated(ui, repo, *args, **kwargs): |
459 ui.warn(_('this command has been deprecated in the git project, ' + | 459 ui.warn(_('this command has been deprecated in the git project, ' |
460 'thus isn\'t supported by this tool.\n\n')) | 460 'thus isn\'t supported by this tool.\n\n')) |
461 | 461 |
462 def diff(ui, repo, *args, **kwargs): | 462 def diff(ui, repo, *args, **kwargs): |
463 cmdoptions = [ | 463 cmdoptions = [ |
464 ('a', 'all', None, ''), | 464 ('a', 'all', None, ''), |
465 ('', 'cached', None, ''), | 465 ('', 'cached', None, ''), |
468 args, opts = parseoptions(ui, cmdoptions, args) | 468 args, opts = parseoptions(ui, cmdoptions, args) |
469 | 469 |
470 cmd = Command('diff') | 470 cmd = Command('diff') |
471 | 471 |
472 if opts.get('cached'): | 472 if opts.get('cached'): |
473 ui.status(_('note: Mercurial has no concept of a staging area, ' + | 473 ui.status(_('note: Mercurial has no concept of a staging area, ' |
474 'so --cached does nothing.\n\n')) | 474 'so --cached does nothing.\n\n')) |
475 | 475 |
476 if opts.get('reverse'): | 476 if opts.get('reverse'): |
477 cmd['--reverse'] = None | 477 cmd['--reverse'] = None |
478 | 478 |
479 for a in list(args): | 479 for a in list(args): |
505 cmd = Command('pull') | 505 cmd = Command('pull') |
506 | 506 |
507 if len(args) > 0: | 507 if len(args) > 0: |
508 cmd.append(args[0]) | 508 cmd.append(args[0]) |
509 if len(args) > 1: | 509 if len(args) > 1: |
510 ui.status(_("note: Mercurial doesn't have refspecs. " + | 510 ui.status(_("note: Mercurial doesn't have refspecs. " |
511 "-r can be used to specify which commits you want to pull. " + | 511 "-r can be used to specify which commits you want to " |
512 "-B can be used to specify which bookmark you want to pull." + | 512 "pull. -B can be used to specify which bookmark you " |
513 "\n\n")) | 513 "want to pull.\n\n")) |
514 for v in args[1:]: | 514 for v in args[1:]: |
515 if v in repo._bookmarks: | 515 if v in repo._bookmarks: |
516 cmd['-B'] = v | 516 cmd['-B'] = v |
517 else: | 517 else: |
518 cmd['-r'] = v | 518 cmd['-r'] = v |
556 ('', 'stat', None, ''), | 556 ('', 'stat', None, ''), |
557 ('', 'graph', None, ''), | 557 ('', 'graph', None, ''), |
558 ('p', 'patch', None, ''), | 558 ('p', 'patch', None, ''), |
559 ] | 559 ] |
560 args, opts = parseoptions(ui, cmdoptions, args) | 560 args, opts = parseoptions(ui, cmdoptions, args) |
561 ui.status(_('note: -v prints the entire commit message like Git does. To ' + | 561 ui.status(_('note: -v prints the entire commit message like Git does. To ' |
562 'print just the first line, drop the -v.\n\n')) | 562 'print just the first line, drop the -v.\n\n')) |
563 ui.status(_("note: see hg help revset for information on how to filter " + | 563 ui.status(_("note: see hg help revset for information on how to filter " |
564 "log output.\n\n")) | 564 "log output.\n\n")) |
565 | 565 |
566 cmd = Command('log') | 566 cmd = Command('log') |
567 cmd['-v'] = None | 567 cmd['-v'] = None |
568 | 568 |
569 if opts.get('number'): | 569 if opts.get('number'): |
578 cmd['-p'] = None | 578 cmd['-p'] = None |
579 | 579 |
580 if opts.get('pretty') or opts.get('format') or opts.get('oneline'): | 580 if opts.get('pretty') or opts.get('format') or opts.get('oneline'): |
581 format = opts.get('format', '') | 581 format = opts.get('format', '') |
582 if 'format:' in format: | 582 if 'format:' in format: |
583 ui.status(_("note: --format format:??? equates to Mercurial's " + | 583 ui.status(_("note: --format format:??? equates to Mercurial's " |
584 "--template. See hg help templates for more info.\n\n")) | 584 "--template. See hg help templates for more info.\n\n")) |
585 cmd['--template'] = '???' | 585 cmd['--template'] = '???' |
586 else: | 586 else: |
587 ui.status(_("note: --pretty/format/oneline equate to Mercurial's " + | 587 ui.status(_("note: --pretty/format/oneline equate to Mercurial's " |
588 "--style or --template. See hg help templates for more info." + | 588 "--style or --template. See hg help templates for " |
589 "\n\n")) | 589 "more info.\n\n")) |
590 cmd['--style'] = '???' | 590 cmd['--style'] = '???' |
591 | 591 |
592 if len(args) > 0: | 592 if len(args) > 0: |
593 if '..' in args[0]: | 593 if '..' in args[0]: |
594 since, until = args[0].split('..') | 594 since, until = args[0].split('..') |
697 cmd['--rebase'] = None | 697 cmd['--rebase'] = None |
698 | 698 |
699 if len(args) > 0: | 699 if len(args) > 0: |
700 cmd.append(args[0]) | 700 cmd.append(args[0]) |
701 if len(args) > 1: | 701 if len(args) > 1: |
702 ui.status(_("note: Mercurial doesn't have refspecs. " + | 702 ui.status(_("note: Mercurial doesn't have refspecs. " |
703 "-r can be used to specify which commits you want to pull. " + | 703 "-r can be used to specify which commits you want to " |
704 "-B can be used to specify which bookmark you want to pull." + | 704 "pull. -B can be used to specify which bookmark you " |
705 "\n\n")) | 705 "want to pull.\n\n")) |
706 for v in args[1:]: | 706 for v in args[1:]: |
707 if v in repo._bookmarks: | 707 if v in repo._bookmarks: |
708 cmd['-B'] = v | 708 cmd['-B'] = v |
709 else: | 709 else: |
710 cmd['-r'] = v | 710 cmd['-r'] = v |
721 cmd = Command('push') | 721 cmd = Command('push') |
722 | 722 |
723 if len(args) > 0: | 723 if len(args) > 0: |
724 cmd.append(args[0]) | 724 cmd.append(args[0]) |
725 if len(args) > 1: | 725 if len(args) > 1: |
726 ui.status(_("note: Mercurial doesn't have refspecs. " + | 726 ui.status(_("note: Mercurial doesn't have refspecs. " |
727 "-r can be used to specify which commits you want to push. " + | 727 "-r can be used to specify which commits you want " |
728 "-B can be used to specify which bookmark you want to push." + | 728 "to push. -B can be used to specify which bookmark " |
729 "\n\n")) | 729 "you want to push.\n\n")) |
730 for v in args[1:]: | 730 for v in args[1:]: |
731 if v in repo._bookmarks: | 731 if v in repo._bookmarks: |
732 cmd['-B'] = v | 732 cmd['-B'] = v |
733 else: | 733 else: |
734 cmd['-r'] = v | 734 cmd['-r'] = v |
748 ('', 'skip', None, ''), | 748 ('', 'skip', None, ''), |
749 ] | 749 ] |
750 args, opts = parseoptions(ui, cmdoptions, args) | 750 args, opts = parseoptions(ui, cmdoptions, args) |
751 | 751 |
752 if opts.get('interactive'): | 752 if opts.get('interactive'): |
753 ui.status(_("note: hg histedit does not perform a rebase. " + | 753 ui.status(_("note: hg histedit does not perform a rebase. " |
754 "It just edits history.\n\n")) | 754 "It just edits history.\n\n")) |
755 cmd = Command('histedit') | 755 cmd = Command('histedit') |
756 if len(args) > 0: | 756 if len(args) > 0: |
757 ui.status(_("also note: 'hg histedit' will automatically detect" | 757 ui.status(_("also note: 'hg histedit' will automatically detect" |
758 " your stack, so no second argument is necessary.\n\n")) | 758 " your stack, so no second argument is necessary.\n\n")) |
759 ui.status((bytes(cmd)), "\n") | 759 ui.status((bytes(cmd)), "\n") |
769 cmd['--continue'] = None | 769 cmd['--continue'] = None |
770 if opts.get('abort'): | 770 if opts.get('abort'): |
771 cmd['--abort'] = None | 771 cmd['--abort'] = None |
772 | 772 |
773 if opts.get('onto'): | 773 if opts.get('onto'): |
774 ui.status(_("note: if you're trying to lift a commit off one branch, " + | 774 ui.status(_("note: if you're trying to lift a commit off one branch, " |
775 "try hg rebase -d <destination commit> -s <commit to be lifted>" + | 775 "try hg rebase -d <destination commit> -s <commit to be " |
776 "\n\n")) | 776 "lifted>\n\n")) |
777 cmd['-d'] = convert(opts.get('onto')) | 777 cmd['-d'] = convert(opts.get('onto')) |
778 if len(args) < 2: | 778 if len(args) < 2: |
779 raise error.Abort(_("expected format: git rebase --onto X Y Z")) | 779 raise error.Abort(_("expected format: git rebase --onto X Y Z")) |
780 cmd['-s'] = "'::%s - ::%s'" % (convert(args[1]), convert(args[0])) | 780 cmd['-s'] = "'::%s - ::%s'" % (convert(args[1]), convert(args[0])) |
781 else: | 781 else: |
833 cmdoptions = [ | 833 cmdoptions = [ |
834 ] | 834 ] |
835 args, opts = parseoptions(ui, cmdoptions, args) | 835 args, opts = parseoptions(ui, cmdoptions, args) |
836 | 836 |
837 if len(args) > 1: | 837 if len(args) > 1: |
838 ui.status(_("note: hg backout doesn't support multiple commits at " + | 838 ui.status(_("note: hg backout doesn't support multiple commits at " |
839 "once\n\n")) | 839 "once\n\n")) |
840 | 840 |
841 cmd = Command('backout') | 841 cmd = Command('backout') |
842 if args: | 842 if args: |
843 cmd.append(args[0]) | 843 cmd.append(args[0]) |
930 cmd.append(args[1]) | 930 cmd.append(args[1]) |
931 if action == 'apply': | 931 if action == 'apply': |
932 cmd['--keep'] = None | 932 cmd['--keep'] = None |
933 elif (action == 'branch' or action == 'show' or action == 'clear' | 933 elif (action == 'branch' or action == 'show' or action == 'clear' |
934 or action == 'create'): | 934 or action == 'create'): |
935 ui.status(_("note: Mercurial doesn't have equivalents to the " + | 935 ui.status(_("note: Mercurial doesn't have equivalents to the " |
936 "git stash branch, show, clear, or create actions.\n\n")) | 936 "git stash branch, show, clear, or create actions.\n\n")) |
937 return | 937 return |
938 else: | 938 else: |
939 if len(args) > 0: | 939 if len(args) > 0: |
940 if args[0] != 'save': | 940 if args[0] != 'save': |
941 cmd['--name'] = args[0] | 941 cmd['--name'] = args[0] |