comparison mercurial/commands.py @ 11321:40c06bbf58be

help: show value requirement and multiple occurrence of options this helps users to know what kind of option is: - no value is required(flag option) - value is required - value is required, and multiple occurrences are allowed each kinds are shown as below: -f --force force push -e --ssh CMD specify ssh command to use -b --branch BRANCH [+] a specific branch you would like to push if one or more 3rd type options are shown, explanation for '[+]' mark is also shown as footnote.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sun, 06 Jun 2010 17:25:00 +0900
parents b66e414d38b0
children 997ab9af81df
comparison
equal deleted inserted replaced
11320:e4274f9f97c8 11321:40c06bbf58be
1827 if text: 1827 if text:
1828 ui.write("\n%s\n" % minirst.format(text, textwidth)) 1828 ui.write("\n%s\n" % minirst.format(text, textwidth))
1829 1829
1830 # list all option lists 1830 # list all option lists
1831 opt_output = [] 1831 opt_output = []
1832 multioccur = False
1832 for title, options in option_lists: 1833 for title, options in option_lists:
1833 opt_output.append(("\n%s" % title, None)) 1834 opt_output.append(("\n%s" % title, None))
1834 for shortopt, longopt, default, desc in options: 1835 for option in options:
1836 if len(option) == 5:
1837 shortopt, longopt, default, desc, optlabel = option
1838 else:
1839 shortopt, longopt, default, desc = option
1840 optlabel = _("VALUE") # default label
1841
1835 if _("DEPRECATED") in desc and not ui.verbose: 1842 if _("DEPRECATED") in desc and not ui.verbose:
1836 continue 1843 continue
1837 opt_output.append(("%2s%s" % (shortopt and "-%s" % shortopt, 1844 if isinstance(default, list):
1838 longopt and " --%s" % longopt), 1845 numqualifier = " %s [+]" % optlabel
1846 multioccur = True
1847 elif (default is not None) and not isinstance(default, bool):
1848 numqualifier = " %s" % optlabel
1849 else:
1850 numqualifier = ""
1851 opt_output.append(("%2s%s" %
1852 (shortopt and "-%s" % shortopt,
1853 longopt and " --%s%s" %
1854 (longopt, numqualifier)),
1839 "%s%s" % (desc, 1855 "%s%s" % (desc,
1840 default 1856 default
1841 and _(" (default: %s)") % default 1857 and _(" (default: %s)") % default
1842 or ""))) 1858 or "")))
1859 if multioccur:
1860 msg = _("\n[+] marked option can be specified multiple times")
1861 if ui.verbose and name != 'shortlist':
1862 opt_output.append((msg, ()))
1863 else:
1864 opt_output.insert(-1, (msg, ()))
1843 1865
1844 if not name: 1866 if not name:
1845 ui.write(_("\nadditional help topics:\n\n")) 1867 ui.write(_("\nadditional help topics:\n\n"))
1846 topics = [] 1868 topics = []
1847 for names, header, doc in help.helptable: 1869 for names, header, doc in help.helptable:
3610 3632
3611 # Command options and aliases are listed here, alphabetically 3633 # Command options and aliases are listed here, alphabetically
3612 3634
3613 globalopts = [ 3635 globalopts = [
3614 ('R', 'repository', '', 3636 ('R', 'repository', '',
3615 _('repository root directory or name of overlay bundle file')), 3637 _('repository root directory or name of overlay bundle file'),
3616 ('', 'cwd', '', _('change working directory')), 3638 _('REPO')),
3639 ('', 'cwd', '',
3640 _('change working directory'), _('DIR')),
3617 ('y', 'noninteractive', None, 3641 ('y', 'noninteractive', None,
3618 _('do not prompt, assume \'yes\' for any required answers')), 3642 _('do not prompt, assume \'yes\' for any required answers')),
3619 ('q', 'quiet', None, _('suppress output')), 3643 ('q', 'quiet', None, _('suppress output')),
3620 ('v', 'verbose', None, _('enable additional output')), 3644 ('v', 'verbose', None, _('enable additional output')),
3621 ('', 'config', [], 3645 ('', 'config', [],
3622 _('set/override config option (use \'section.name=value\')')), 3646 _('set/override config option (use \'section.name=value\')'),
3647 _('CONFIG')),
3623 ('', 'debug', None, _('enable debugging output')), 3648 ('', 'debug', None, _('enable debugging output')),
3624 ('', 'debugger', None, _('start debugger')), 3649 ('', 'debugger', None, _('start debugger')),
3625 ('', 'encoding', encoding.encoding, _('set the charset encoding')), 3650 ('', 'encoding', encoding.encoding, _('set the charset encoding'),
3651 _('ENCODE')),
3626 ('', 'encodingmode', encoding.encodingmode, 3652 ('', 'encodingmode', encoding.encodingmode,
3627 _('set the charset encoding mode')), 3653 _('set the charset encoding mode'), _('MODE')),
3628 ('', 'traceback', None, _('always print a traceback on exception')), 3654 ('', 'traceback', None, _('always print a traceback on exception')),
3629 ('', 'time', None, _('time how long the command takes')), 3655 ('', 'time', None, _('time how long the command takes')),
3630 ('', 'profile', None, _('print command execution profile')), 3656 ('', 'profile', None, _('print command execution profile')),
3631 ('', 'version', None, _('output version information and exit')), 3657 ('', 'version', None, _('output version information and exit')),
3632 ('h', 'help', None, _('display help and exit')), 3658 ('h', 'help', None, _('display help and exit')),
3634 3660
3635 dryrunopts = [('n', 'dry-run', None, 3661 dryrunopts = [('n', 'dry-run', None,
3636 _('do not perform actions, just print output'))] 3662 _('do not perform actions, just print output'))]
3637 3663
3638 remoteopts = [ 3664 remoteopts = [
3639 ('e', 'ssh', '', _('specify ssh command to use')), 3665 ('e', 'ssh', '',
3640 ('', 'remotecmd', '', _('specify hg command to run on the remote side')), 3666 _('specify ssh command to use'), _('CMD')),
3667 ('', 'remotecmd', '',
3668 _('specify hg command to run on the remote side'), _('CMD')),
3641 ] 3669 ]
3642 3670
3643 walkopts = [ 3671 walkopts = [
3644 ('I', 'include', [], _('include names matching the given patterns')), 3672 ('I', 'include', [],
3645 ('X', 'exclude', [], _('exclude names matching the given patterns')), 3673 _('include names matching the given patterns'), _('PATTERN')),
3674 ('X', 'exclude', [],
3675 _('exclude names matching the given patterns'), _('PATTERN')),
3646 ] 3676 ]
3647 3677
3648 commitopts = [ 3678 commitopts = [
3649 ('m', 'message', '', _('use <text> as commit message')), 3679 ('m', 'message', '',
3650 ('l', 'logfile', '', _('read commit message from <file>')), 3680 _('use text as commit message'), _('TEXT')),
3681 ('l', 'logfile', '',
3682 _('read commit message from file'), _('FILE')),
3651 ] 3683 ]
3652 3684
3653 commitopts2 = [ 3685 commitopts2 = [
3654 ('d', 'date', '', _('record datecode as commit date')), 3686 ('d', 'date', '',
3655 ('u', 'user', '', _('record the specified user as committer')), 3687 _('record datecode as commit date'), _('DATE')),
3688 ('u', 'user', '',
3689 _('record the specified user as committer'), _('USER')),
3656 ] 3690 ]
3657 3691
3658 templateopts = [ 3692 templateopts = [
3659 ('', 'style', '', _('display using template map file')), 3693 ('', 'style', '',
3660 ('', 'template', '', _('display with template')), 3694 _('display using template map file'), _('STYLE')),
3695 ('', 'template', '',
3696 _('display with template'), _('TEMPLATE')),
3661 ] 3697 ]
3662 3698
3663 logopts = [ 3699 logopts = [
3664 ('p', 'patch', None, _('show patch')), 3700 ('p', 'patch', None, _('show patch')),
3665 ('g', 'git', None, _('use git extended diff format')), 3701 ('g', 'git', None, _('use git extended diff format')),
3666 ('l', 'limit', '', _('limit number of changes displayed')), 3702 ('l', 'limit', '',
3703 _('limit number of changes displayed'), _('NUM')),
3667 ('M', 'no-merges', None, _('do not show merges')), 3704 ('M', 'no-merges', None, _('do not show merges')),
3668 ('', 'stat', None, _('output diffstat-style summary of changes')), 3705 ('', 'stat', None, _('output diffstat-style summary of changes')),
3669 ] + templateopts 3706 ] + templateopts
3670 3707
3671 diffopts = [ 3708 diffopts = [
3681 _('ignore white space when comparing lines')), 3718 _('ignore white space when comparing lines')),
3682 ('b', 'ignore-space-change', None, 3719 ('b', 'ignore-space-change', None,
3683 _('ignore changes in the amount of white space')), 3720 _('ignore changes in the amount of white space')),
3684 ('B', 'ignore-blank-lines', None, 3721 ('B', 'ignore-blank-lines', None,
3685 _('ignore changes whose lines are all blank')), 3722 _('ignore changes whose lines are all blank')),
3686 ('U', 'unified', '', _('number of lines of context to show')), 3723 ('U', 'unified', '',
3724 _('number of lines of context to show'), _('NUM')),
3687 ('', 'stat', None, _('output diffstat-style summary of changes')), 3725 ('', 'stat', None, _('output diffstat-style summary of changes')),
3688 ] 3726 ]
3689 3727
3690 similarityopts = [ 3728 similarityopts = [
3691 ('s', 'similarity', '', 3729 ('s', 'similarity', '',
3692 _('guess renamed files by similarity (0<=s<=100)')) 3730 _('guess renamed files by similarity (0<=s<=100)'), _('SIMILARITY'))
3693 ] 3731 ]
3694 3732
3695 table = { 3733 table = {
3696 "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')), 3734 "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')),
3697 "addremove": 3735 "addremove":
3698 (addremove, similarityopts + walkopts + dryrunopts, 3736 (addremove, similarityopts + walkopts + dryrunopts,
3699 _('[OPTION]... [FILE]...')), 3737 _('[OPTION]... [FILE]...')),
3700 "^annotate|blame": 3738 "^annotate|blame":
3701 (annotate, 3739 (annotate,
3702 [('r', 'rev', '', _('annotate the specified revision')), 3740 [('r', 'rev', '',
3741 _('annotate the specified revision'), _('REV')),
3703 ('', 'follow', None, 3742 ('', 'follow', None,
3704 _('follow copies/renames and list the filename (DEPRECATED)')), 3743 _('follow copies/renames and list the filename (DEPRECATED)')),
3705 ('', 'no-follow', None, _("don't follow copies and renames")), 3744 ('', 'no-follow', None, _("don't follow copies and renames")),
3706 ('a', 'text', None, _('treat all files as text')), 3745 ('a', 'text', None, _('treat all files as text')),
3707 ('u', 'user', None, _('list the author (long with -v)')), 3746 ('u', 'user', None, _('list the author (long with -v)')),
3714 ] + walkopts, 3753 ] + walkopts,
3715 _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...')), 3754 _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...')),
3716 "archive": 3755 "archive":
3717 (archive, 3756 (archive,
3718 [('', 'no-decode', None, _('do not pass files through decoders')), 3757 [('', 'no-decode', None, _('do not pass files through decoders')),
3719 ('p', 'prefix', '', _('directory prefix for files in archive')), 3758 ('p', 'prefix', '',
3720 ('r', 'rev', '', _('revision to distribute')), 3759 _('directory prefix for files in archive'), _('PREFIX')),
3721 ('t', 'type', '', _('type of distribution to create')), 3760 ('r', 'rev', '',
3761 _('revision to distribute'), _('REV')),
3762 ('t', 'type', '',
3763 _('type of distribution to create'), _('TYPE')),
3722 ] + walkopts, 3764 ] + walkopts,
3723 _('[OPTION]... DEST')), 3765 _('[OPTION]... DEST')),
3724 "backout": 3766 "backout":
3725 (backout, 3767 (backout,
3726 [('', 'merge', None, 3768 [('', 'merge', None,
3727 _('merge with old dirstate parent after backout')), 3769 _('merge with old dirstate parent after backout')),
3728 ('', 'parent', '', _('parent to choose when backing out merge')), 3770 ('', 'parent', '',
3729 ('r', 'rev', '', _('revision to backout')), 3771 _('parent to choose when backing out merge'), _('REV')),
3772 ('r', 'rev', '',
3773 _('revision to backout'), _('REV')),
3730 ] + walkopts + commitopts + commitopts2, 3774 ] + walkopts + commitopts + commitopts2,
3731 _('[OPTION]... [-r] REV')), 3775 _('[OPTION]... [-r] REV')),
3732 "bisect": 3776 "bisect":
3733 (bisect, 3777 (bisect,
3734 [('r', 'reset', False, _('reset bisect state')), 3778 [('r', 'reset', False, _('reset bisect state')),
3735 ('g', 'good', False, _('mark changeset good')), 3779 ('g', 'good', False, _('mark changeset good')),
3736 ('b', 'bad', False, _('mark changeset bad')), 3780 ('b', 'bad', False, _('mark changeset bad')),
3737 ('s', 'skip', False, _('skip testing changeset')), 3781 ('s', 'skip', False, _('skip testing changeset')),
3738 ('c', 'command', '', _('use command to check changeset state')), 3782 ('c', 'command', '',
3783 _('use command to check changeset state'), _('CMD')),
3739 ('U', 'noupdate', False, _('do not update to target'))], 3784 ('U', 'noupdate', False, _('do not update to target'))],
3740 _("[-gbsr] [-U] [-c CMD] [REV]")), 3785 _("[-gbsr] [-U] [-c CMD] [REV]")),
3741 "branch": 3786 "branch":
3742 (branch, 3787 (branch,
3743 [('f', 'force', None, 3788 [('f', 'force', None,
3754 "bundle": 3799 "bundle":
3755 (bundle, 3800 (bundle,
3756 [('f', 'force', None, 3801 [('f', 'force', None,
3757 _('run even when the destination is unrelated')), 3802 _('run even when the destination is unrelated')),
3758 ('r', 'rev', [], 3803 ('r', 'rev', [],
3759 _('a changeset intended to be added to the destination')), 3804 _('a changeset intended to be added to the destination'),
3805 _('REV')),
3760 ('b', 'branch', [], 3806 ('b', 'branch', [],
3761 _('a specific branch you would like to bundle')), 3807 _('a specific branch you would like to bundle'),
3808 _('BRANCH')),
3762 ('', 'base', [], 3809 ('', 'base', [],
3763 _('a base changeset assumed to be available at the destination')), 3810 _('a base changeset assumed to be available at the destination'),
3811 _('REV')),
3764 ('a', 'all', None, _('bundle all changesets in the repository')), 3812 ('a', 'all', None, _('bundle all changesets in the repository')),
3765 ('t', 'type', 'bzip2', _('bundle compression type to use')), 3813 ('t', 'type', 'bzip2',
3814 _('bundle compression type to use'), _('TYPE')),
3766 ] + remoteopts, 3815 ] + remoteopts,
3767 _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')), 3816 _('[-f] [-t TYPE] [-a] [-r REV]... [--base REV]... FILE [DEST]')),
3768 "cat": 3817 "cat":
3769 (cat, 3818 (cat,
3770 [('o', 'output', '', _('print output to file with formatted name')), 3819 [('o', 'output', '',
3771 ('r', 'rev', '', _('print the given revision')), 3820 _('print output to file with formatted name'), _('FORMAT')),
3821 ('r', 'rev', '',
3822 _('print the given revision'), _('REV')),
3772 ('', 'decode', None, _('apply any matching decode filter')), 3823 ('', 'decode', None, _('apply any matching decode filter')),
3773 ] + walkopts, 3824 ] + walkopts,
3774 _('[OPTION]... FILE...')), 3825 _('[OPTION]... FILE...')),
3775 "^clone": 3826 "^clone":
3776 (clone, 3827 (clone,
3777 [('U', 'noupdate', None, 3828 [('U', 'noupdate', None,
3778 _('the clone will include an empty working copy (only a repository)')), 3829 _('the clone will include an empty working copy (only a repository)')),
3779 ('u', 'updaterev', '', 3830 ('u', 'updaterev', '',
3780 _('revision, tag or branch to check out')), 3831 _('revision, tag or branch to check out'), _('REV')),
3781 ('r', 'rev', [], 3832 ('r', 'rev', [],
3782 _('include the specified changeset')), 3833 _('include the specified changeset'), _('REV')),
3783 ('b', 'branch', [], 3834 ('b', 'branch', [],
3784 _('clone only the specified branch')), 3835 _('clone only the specified branch'), _('BRANCH')),
3785 ('', 'pull', None, _('use pull protocol to copy metadata')), 3836 ('', 'pull', None, _('use pull protocol to copy metadata')),
3786 ('', 'uncompressed', None, 3837 ('', 'uncompressed', None,
3787 _('use uncompressed transfer (fast over LAN)')), 3838 _('use uncompressed transfer (fast over LAN)')),
3788 ] + remoteopts, 3839 ] + remoteopts,
3789 _('[OPTION]... SOURCE [DEST]')), 3840 _('[OPTION]... SOURCE [DEST]')),
3818 "debugindex": (debugindex, [], _('FILE')), 3869 "debugindex": (debugindex, [], _('FILE')),
3819 "debugindexdot": (debugindexdot, [], _('FILE')), 3870 "debugindexdot": (debugindexdot, [], _('FILE')),
3820 "debuginstall": (debuginstall, [], ''), 3871 "debuginstall": (debuginstall, [], ''),
3821 "debugrebuildstate": 3872 "debugrebuildstate":
3822 (debugrebuildstate, 3873 (debugrebuildstate,
3823 [('r', 'rev', '', _('revision to rebuild to'))], 3874 [('r', 'rev', '',
3875 _('revision to rebuild to'), _('REV'))],
3824 _('[-r REV] [REV]')), 3876 _('[-r REV] [REV]')),
3825 "debugrename": 3877 "debugrename":
3826 (debugrename, 3878 (debugrename,
3827 [('r', 'rev', '', _('revision to debug'))], 3879 [('r', 'rev', '',
3880 _('revision to debug'), _('REV'))],
3828 _('[-r REV] FILE')), 3881 _('[-r REV] FILE')),
3829 "debugrevspec": 3882 "debugrevspec":
3830 (debugrevspec, [], ('REVSPEC')), 3883 (debugrevspec, [], ('REVSPEC')),
3831 "debugsetparents": 3884 "debugsetparents":
3832 (debugsetparents, [], _('REV1 [REV2]')), 3885 (debugsetparents, [], _('REV1 [REV2]')),
3834 (debugstate, 3887 (debugstate,
3835 [('', 'nodates', None, _('do not display the saved mtime'))], 3888 [('', 'nodates', None, _('do not display the saved mtime'))],
3836 _('[OPTION]...')), 3889 _('[OPTION]...')),
3837 "debugsub": 3890 "debugsub":
3838 (debugsub, 3891 (debugsub,
3839 [('r', 'rev', '', _('revision to check'))], 3892 [('r', 'rev', '',
3893 _('revision to check'), _('REV'))],
3840 _('[-r REV] [REV]')), 3894 _('[-r REV] [REV]')),
3841 "debugwalk": (debugwalk, walkopts, _('[OPTION]... [FILE]...')), 3895 "debugwalk": (debugwalk, walkopts, _('[OPTION]... [FILE]...')),
3842 "^diff": 3896 "^diff":
3843 (diff, 3897 (diff,
3844 [('r', 'rev', [], _('revision')), 3898 [('r', 'rev', [],
3845 ('c', 'change', '', _('change made by revision')) 3899 _('revision'), _('REV')),
3900 ('c', 'change', '',
3901 _('change made by revision'), _('REV'))
3846 ] + diffopts + diffopts2 + walkopts, 3902 ] + diffopts + diffopts2 + walkopts,
3847 _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...')), 3903 _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...')),
3848 "^export": 3904 "^export":
3849 (export, 3905 (export,
3850 [('o', 'output', '', _('print output to file with formatted name')), 3906 [('o', 'output', '',
3907 _('print output to file with formatted name'), _('FORMAT')),
3851 ('', 'switch-parent', None, _('diff against the second parent')), 3908 ('', 'switch-parent', None, _('diff against the second parent')),
3852 ('r', 'rev', [], _('revisions to export')), 3909 ('r', 'rev', [],
3910 _('revisions to export'), _('REV')),
3853 ] + diffopts, 3911 ] + diffopts,
3854 _('[OPTION]... [-o OUTFILESPEC] REV...')), 3912 _('[OPTION]... [-o OUTFILESPEC] REV...')),
3855 "^forget": 3913 "^forget":
3856 (forget, 3914 (forget,
3857 [] + walkopts, 3915 [] + walkopts,
3865 ' or file history across copies and renames')), 3923 ' or file history across copies and renames')),
3866 ('i', 'ignore-case', None, _('ignore case when matching')), 3924 ('i', 'ignore-case', None, _('ignore case when matching')),
3867 ('l', 'files-with-matches', None, 3925 ('l', 'files-with-matches', None,
3868 _('print only filenames and revisions that match')), 3926 _('print only filenames and revisions that match')),
3869 ('n', 'line-number', None, _('print matching line numbers')), 3927 ('n', 'line-number', None, _('print matching line numbers')),
3870 ('r', 'rev', [], _('only search files changed within revision range')), 3928 ('r', 'rev', [],
3929 _('only search files changed within revision range'), _('REV')),
3871 ('u', 'user', None, _('list the author (long with -v)')), 3930 ('u', 'user', None, _('list the author (long with -v)')),
3872 ('d', 'date', None, _('list the date (short with -q)')), 3931 ('d', 'date', None, _('list the date (short with -q)')),
3873 ] + walkopts, 3932 ] + walkopts,
3874 _('[OPTION]... PATTERN [FILE]...')), 3933 _('[OPTION]... PATTERN [FILE]...')),
3875 "heads": 3934 "heads":
3876 (heads, 3935 (heads,
3877 [('r', 'rev', '', _('show only heads which are descendants of REV')), 3936 [('r', 'rev', '',
3937 _('show only heads which are descendants of REV'), _('REV')),
3878 ('t', 'topo', False, _('show topological heads only')), 3938 ('t', 'topo', False, _('show topological heads only')),
3879 ('a', 'active', False, 3939 ('a', 'active', False,
3880 _('show active branchheads only [DEPRECATED]')), 3940 _('show active branchheads only [DEPRECATED]')),
3881 ('c', 'closed', False, 3941 ('c', 'closed', False,
3882 _('show normal and closed branch heads')), 3942 _('show normal and closed branch heads')),
3883 ] + templateopts, 3943 ] + templateopts,
3884 _('[-ac] [-r REV] [REV]...')), 3944 _('[-ac] [-r REV] [REV]...')),
3885 "help": (help_, [], _('[TOPIC]')), 3945 "help": (help_, [], _('[TOPIC]')),
3886 "identify|id": 3946 "identify|id":
3887 (identify, 3947 (identify,
3888 [('r', 'rev', '', _('identify the specified revision')), 3948 [('r', 'rev', '',
3949 _('identify the specified revision'), _('REV')),
3889 ('n', 'num', None, _('show local revision number')), 3950 ('n', 'num', None, _('show local revision number')),
3890 ('i', 'id', None, _('show global revision id')), 3951 ('i', 'id', None, _('show global revision id')),
3891 ('b', 'branch', None, _('show branch')), 3952 ('b', 'branch', None, _('show branch')),
3892 ('t', 'tags', None, _('show tags'))], 3953 ('t', 'tags', None, _('show tags'))],
3893 _('[-nibt] [-r REV] [SOURCE]')), 3954 _('[-nibt] [-r REV] [SOURCE]')),
3894 "import|patch": 3955 "import|patch":
3895 (import_, 3956 (import_,
3896 [('p', 'strip', 1, 3957 [('p', 'strip', 1,
3897 _('directory strip option for patch. This has the same ' 3958 _('directory strip option for patch. This has the same '
3898 'meaning as the corresponding patch option')), 3959 'meaning as the corresponding patch option'),
3899 ('b', 'base', '', _('base path')), 3960 _('NUM')),
3961 ('b', 'base', '',
3962 _('base path'), _('PATH')),
3900 ('f', 'force', None, 3963 ('f', 'force', None,
3901 _('skip check for outstanding uncommitted changes')), 3964 _('skip check for outstanding uncommitted changes')),
3902 ('', 'no-commit', None, 3965 ('', 'no-commit', None,
3903 _("don't commit, just update the working directory")), 3966 _("don't commit, just update the working directory")),
3904 ('', 'exact', None, 3967 ('', 'exact', None,
3910 "incoming|in": 3973 "incoming|in":
3911 (incoming, 3974 (incoming,
3912 [('f', 'force', None, 3975 [('f', 'force', None,
3913 _('run even if remote repository is unrelated')), 3976 _('run even if remote repository is unrelated')),
3914 ('n', 'newest-first', None, _('show newest record first')), 3977 ('n', 'newest-first', None, _('show newest record first')),
3915 ('', 'bundle', '', _('file to store the bundles into')), 3978 ('', 'bundle', '',
3979 _('file to store the bundles into'), _('FILE')),
3916 ('r', 'rev', [], 3980 ('r', 'rev', [],
3917 _('a remote changeset intended to be added')), 3981 _('a remote changeset intended to be added'), _('REV')),
3918 ('b', 'branch', [], 3982 ('b', 'branch', [],
3919 _('a specific branch you would like to pull')), 3983 _('a specific branch you would like to pull'), _('BRANCH')),
3920 ] + logopts + remoteopts, 3984 ] + logopts + remoteopts,
3921 _('[-p] [-n] [-M] [-f] [-r REV]...' 3985 _('[-p] [-n] [-M] [-f] [-r REV]...'
3922 ' [--bundle FILENAME] [SOURCE]')), 3986 ' [--bundle FILENAME] [SOURCE]')),
3923 "^init": 3987 "^init":
3924 (init, 3988 (init,
3925 remoteopts, 3989 remoteopts,
3926 _('[-e CMD] [--remotecmd CMD] [DEST]')), 3990 _('[-e CMD] [--remotecmd CMD] [DEST]')),
3927 "locate": 3991 "locate":
3928 (locate, 3992 (locate,
3929 [('r', 'rev', '', _('search the repository as it is in REV')), 3993 [('r', 'rev', '',
3994 _('search the repository as it is in REV'), _('REV')),
3930 ('0', 'print0', None, 3995 ('0', 'print0', None,
3931 _('end filenames with NUL, for use with xargs')), 3996 _('end filenames with NUL, for use with xargs')),
3932 ('f', 'fullpath', None, 3997 ('f', 'fullpath', None,
3933 _('print complete paths from the filesystem root')), 3998 _('print complete paths from the filesystem root')),
3934 ] + walkopts, 3999 ] + walkopts,
3938 [('f', 'follow', None, 4003 [('f', 'follow', None,
3939 _('follow changeset history,' 4004 _('follow changeset history,'
3940 ' or file history across copies and renames')), 4005 ' or file history across copies and renames')),
3941 ('', 'follow-first', None, 4006 ('', 'follow-first', None,
3942 _('only follow the first parent of merge changesets')), 4007 _('only follow the first parent of merge changesets')),
3943 ('d', 'date', '', _('show revisions matching date spec')), 4008 ('d', 'date', '',
4009 _('show revisions matching date spec'), _('DATE')),
3944 ('C', 'copies', None, _('show copied files')), 4010 ('C', 'copies', None, _('show copied files')),
3945 ('k', 'keyword', [], _('do case-insensitive search for a keyword')), 4011 ('k', 'keyword', [],
3946 ('r', 'rev', [], _('show the specified revision or range')), 4012 _('do case-insensitive search for a given text'), _('TEXT')),
4013 ('r', 'rev', [],
4014 _('show the specified revision or range'), _('REV')),
3947 ('', 'removed', None, _('include revisions where files were removed')), 4015 ('', 'removed', None, _('include revisions where files were removed')),
3948 ('m', 'only-merges', None, _('show only merges')), 4016 ('m', 'only-merges', None, _('show only merges')),
3949 ('u', 'user', [], _('revisions committed by user')), 4017 ('u', 'user', [],
4018 _('revisions committed by user'), _('USER')),
3950 ('', 'only-branch', [], 4019 ('', 'only-branch', [],
3951 _('show only changesets within the given named branch (DEPRECATED)')), 4020 _('show only changesets within the given named branch (DEPRECATED)'),
4021 _('BRANCH')),
3952 ('b', 'branch', [], 4022 ('b', 'branch', [],
3953 _('show changesets within the given named branch')), 4023 _('show changesets within the given named branch'), _('BRANCH')),
3954 ('P', 'prune', [], 4024 ('P', 'prune', [],
3955 _('do not display revision or any of its ancestors')), 4025 _('do not display revision or any of its ancestors'), _('REV')),
3956 ] + logopts + walkopts, 4026 ] + logopts + walkopts,
3957 _('[OPTION]... [FILE]')), 4027 _('[OPTION]... [FILE]')),
3958 "manifest": 4028 "manifest":
3959 (manifest, 4029 (manifest,
3960 [('r', 'rev', '', _('revision to display'))], 4030 [('r', 'rev', '',
4031 _('revision to display'), _('REV'))],
3961 _('[-r REV]')), 4032 _('[-r REV]')),
3962 "^merge": 4033 "^merge":
3963 (merge, 4034 (merge,
3964 [('f', 'force', None, _('force a merge with outstanding changes')), 4035 [('f', 'force', None, _('force a merge with outstanding changes')),
3965 ('r', 'rev', '', _('revision to merge')), 4036 ('r', 'rev', '',
4037 _('revision to merge'), _('REV')),
3966 ('P', 'preview', None, 4038 ('P', 'preview', None,
3967 _('review revisions to merge (no merge is performed)'))], 4039 _('review revisions to merge (no merge is performed)'))],
3968 _('[-P] [-f] [[-r] REV]')), 4040 _('[-P] [-f] [[-r] REV]')),
3969 "outgoing|out": 4041 "outgoing|out":
3970 (outgoing, 4042 (outgoing,
3971 [('f', 'force', None, 4043 [('f', 'force', None,
3972 _('run even when the destination is unrelated')), 4044 _('run even when the destination is unrelated')),
3973 ('r', 'rev', [], 4045 ('r', 'rev', [],
3974 _('a changeset intended to be included in the destination')), 4046 _('a changeset intended to be included in the destination'),
4047 _('REV')),
3975 ('n', 'newest-first', None, _('show newest record first')), 4048 ('n', 'newest-first', None, _('show newest record first')),
3976 ('b', 'branch', [], 4049 ('b', 'branch', [],
3977 _('a specific branch you would like to push')), 4050 _('a specific branch you would like to push'), _('BRANCH')),
3978 ] + logopts + remoteopts, 4051 ] + logopts + remoteopts,
3979 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')), 4052 _('[-M] [-p] [-n] [-f] [-r REV]... [DEST]')),
3980 "parents": 4053 "parents":
3981 (parents, 4054 (parents,
3982 [('r', 'rev', '', _('show parents of the specified revision')), 4055 [('r', 'rev', '',
4056 _('show parents of the specified revision'), _('REV')),
3983 ] + templateopts, 4057 ] + templateopts,
3984 _('[-r REV] [FILE]')), 4058 _('[-r REV] [FILE]')),
3985 "paths": (paths, [], _('[NAME]')), 4059 "paths": (paths, [], _('[NAME]')),
3986 "^pull": 4060 "^pull":
3987 (pull, 4061 (pull,
3988 [('u', 'update', None, 4062 [('u', 'update', None,
3989 _('update to new branch head if changesets were pulled')), 4063 _('update to new branch head if changesets were pulled')),
3990 ('f', 'force', None, 4064 ('f', 'force', None,
3991 _('run even when remote repository is unrelated')), 4065 _('run even when remote repository is unrelated')),
3992 ('r', 'rev', [], 4066 ('r', 'rev', [],
3993 _('a remote changeset intended to be added')), 4067 _('a remote changeset intended to be added'), _('REV')),
3994 ('b', 'branch', [], 4068 ('b', 'branch', [],
3995 _('a specific branch you would like to pull')), 4069 _('a specific branch you would like to pull'), _('BRANCH')),
3996 ] + remoteopts, 4070 ] + remoteopts,
3997 _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')), 4071 _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]')),
3998 "^push": 4072 "^push":
3999 (push, 4073 (push,
4000 [('f', 'force', None, _('force push')), 4074 [('f', 'force', None, _('force push')),
4001 ('r', 'rev', [], 4075 ('r', 'rev', [],
4002 _('a changeset intended to be included in the destination')), 4076 _('a changeset intended to be included in the destination'),
4077 _('REV')),
4003 ('b', 'branch', [], 4078 ('b', 'branch', [],
4004 _('a specific branch you would like to push')), 4079 _('a specific branch you would like to push'), _('BRANCH')),
4005 ('', 'new-branch', False, _('allow pushing a new branch')), 4080 ('', 'new-branch', False, _('allow pushing a new branch')),
4006 ] + remoteopts, 4081 ] + remoteopts,
4007 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')), 4082 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]')),
4008 "recover": (recover, []), 4083 "recover": (recover, []),
4009 "^remove|rm": 4084 "^remove|rm":
4030 + walkopts, 4105 + walkopts,
4031 _('[OPTION]... [FILE]...')), 4106 _('[OPTION]... [FILE]...')),
4032 "revert": 4107 "revert":
4033 (revert, 4108 (revert,
4034 [('a', 'all', None, _('revert all changes when no arguments given')), 4109 [('a', 'all', None, _('revert all changes when no arguments given')),
4035 ('d', 'date', '', _('tipmost revision matching date')), 4110 ('d', 'date', '',
4036 ('r', 'rev', '', _('revert to the specified revision')), 4111 _('tipmost revision matching date'), _('DATE')),
4112 ('r', 'rev', '',
4113 _('revert to the specified revision'), _('REV')),
4037 ('', 'no-backup', None, _('do not save backup copies of files')), 4114 ('', 'no-backup', None, _('do not save backup copies of files')),
4038 ] + walkopts + dryrunopts, 4115 ] + walkopts + dryrunopts,
4039 _('[OPTION]... [-r REV] [NAME]...')), 4116 _('[OPTION]... [-r REV] [NAME]...')),
4040 "rollback": (rollback, dryrunopts), 4117 "rollback": (rollback, dryrunopts),
4041 "root": (root, []), 4118 "root": (root, []),
4042 "^serve": 4119 "^serve":
4043 (serve, 4120 (serve,
4044 [('A', 'accesslog', '', _('name of access log file to write to')), 4121 [('A', 'accesslog', '',
4122 _('name of access log file to write to'), _('FILE')),
4045 ('d', 'daemon', None, _('run server in background')), 4123 ('d', 'daemon', None, _('run server in background')),
4046 ('', 'daemon-pipefds', '', _('used internally by daemon mode')), 4124 ('', 'daemon-pipefds', '',
4047 ('E', 'errorlog', '', _('name of error log file to write to')), 4125 _('used internally by daemon mode'), _('NUM')),
4126 ('E', 'errorlog', '',
4127 _('name of error log file to write to'), _('FILE')),
4048 # use string type, then we can check if something was passed 4128 # use string type, then we can check if something was passed
4049 ('p', 'port', '', _('port to listen on (default: 8000)')), 4129 ('p', 'port', '',
4130 _('port to listen on (default: 8000)'), _('PORT')),
4050 ('a', 'address', '', 4131 ('a', 'address', '',
4051 _('address to listen on (default: all interfaces)')), 4132 _('address to listen on (default: all interfaces)'), _('ADDR')),
4052 ('', 'prefix', '', 4133 ('', 'prefix', '',
4053 _('prefix path to serve from (default: server root)')), 4134 _('prefix path to serve from (default: server root)'), _('PREFIX')),
4054 ('n', 'name', '', 4135 ('n', 'name', '',
4055 _('name to show in web pages (default: working directory)')), 4136 _('name to show in web pages (default: working directory)'),
4056 ('', 'web-conf', '', _('name of the hgweb config file' 4137 _('NAME')),
4057 ' (serve more than one repository)')), 4138 ('', 'web-conf', '',
4058 ('', 'webdir-conf', '', _('name of the hgweb config file' 4139 _('name of the hgweb config file (serve more than one repository)'),
4059 ' (DEPRECATED)')), 4140 _('FILE')),
4060 ('', 'pid-file', '', _('name of file to write process ID to')), 4141 ('', 'webdir-conf', '',
4142 _('name of the hgweb config file (DEPRECATED)'), _('FILE')),
4143 ('', 'pid-file', '',
4144 _('name of file to write process ID to'), _('FILE')),
4061 ('', 'stdio', None, _('for remote clients')), 4145 ('', 'stdio', None, _('for remote clients')),
4062 ('t', 'templates', '', _('web templates to use')), 4146 ('t', 'templates', '',
4063 ('', 'style', '', _('template style to use')), 4147 _('web templates to use'), _('TEMPLATE')),
4148 ('', 'style', '',
4149 _('template style to use'), _('STYLE')),
4064 ('6', 'ipv6', None, _('use IPv6 in addition to IPv4')), 4150 ('6', 'ipv6', None, _('use IPv6 in addition to IPv4')),
4065 ('', 'certificate', '', _('SSL certificate file'))], 4151 ('', 'certificate', '',
4152 _('SSL certificate file'), _('FILE'))],
4066 _('[OPTION]...')), 4153 _('[OPTION]...')),
4067 "showconfig|debugconfig": 4154 "showconfig|debugconfig":
4068 (showconfig, 4155 (showconfig,
4069 [('u', 'untrusted', None, _('show untrusted configuration options'))], 4156 [('u', 'untrusted', None, _('show untrusted configuration options'))],
4070 _('[-u] [NAME]...')), 4157 _('[-u] [NAME]...')),
4083 ('i', 'ignored', None, _('show only ignored files')), 4170 ('i', 'ignored', None, _('show only ignored files')),
4084 ('n', 'no-status', None, _('hide status prefix')), 4171 ('n', 'no-status', None, _('hide status prefix')),
4085 ('C', 'copies', None, _('show source of copied files')), 4172 ('C', 'copies', None, _('show source of copied files')),
4086 ('0', 'print0', None, 4173 ('0', 'print0', None,
4087 _('end filenames with NUL, for use with xargs')), 4174 _('end filenames with NUL, for use with xargs')),
4088 ('', 'rev', [], _('show difference from revision')), 4175 ('', 'rev', [],
4089 ('', 'change', '', _('list the changed files of a revision')), 4176 _('show difference from revision'), _('REV')),
4177 ('', 'change', '',
4178 _('list the changed files of a revision'), _('REV')),
4090 ] + walkopts, 4179 ] + walkopts,
4091 _('[OPTION]... [FILE]...')), 4180 _('[OPTION]... [FILE]...')),
4092 "tag": 4181 "tag":
4093 (tag, 4182 (tag,
4094 [('f', 'force', None, _('replace existing tag')), 4183 [('f', 'force', None, _('replace existing tag')),
4095 ('l', 'local', None, _('make the tag local')), 4184 ('l', 'local', None, _('make the tag local')),
4096 ('r', 'rev', '', _('revision to tag')), 4185 ('r', 'rev', '',
4186 _('revision to tag'), _('REV')),
4097 ('', 'remove', None, _('remove a tag')), 4187 ('', 'remove', None, _('remove a tag')),
4098 # -l/--local is already there, commitopts cannot be used 4188 # -l/--local is already there, commitopts cannot be used
4099 ('e', 'edit', None, _('edit commit message')), 4189 ('e', 'edit', None, _('edit commit message')),
4100 ('m', 'message', '', _('use <text> as commit message')), 4190 ('m', 'message', '',
4191 _('use <text> as commit message'), _('TEXT')),
4101 ] + commitopts2, 4192 ] + commitopts2,
4102 _('[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...')), 4193 _('[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...')),
4103 "tags": (tags, [], ''), 4194 "tags": (tags, [], ''),
4104 "tip": 4195 "tip":
4105 (tip, 4196 (tip,
4114 _('[-u] FILE...')), 4205 _('[-u] FILE...')),
4115 "^update|up|checkout|co": 4206 "^update|up|checkout|co":
4116 (update, 4207 (update,
4117 [('C', 'clean', None, _('discard uncommitted changes (no backup)')), 4208 [('C', 'clean', None, _('discard uncommitted changes (no backup)')),
4118 ('c', 'check', None, _('check for uncommitted changes')), 4209 ('c', 'check', None, _('check for uncommitted changes')),
4119 ('d', 'date', '', _('tipmost revision matching date')), 4210 ('d', 'date', '',
4120 ('r', 'rev', '', _('revision'))], 4211 _('tipmost revision matching date'), _('DATE')),
4212 ('r', 'rev', '',
4213 _('revision'), _('REV'))],
4121 _('[-c] [-C] [-d DATE] [[-r] REV]')), 4214 _('[-c] [-C] [-d DATE] [[-r] REV]')),
4122 "verify": (verify, []), 4215 "verify": (verify, []),
4123 "version": (version_, []), 4216 "version": (version_, []),
4124 } 4217 }
4125 4218