Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 6192:cd65a67aff31
Introduce templateopts and logopts to reduce duplicate option definitions.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 29 Feb 2008 02:45:12 +0100 |
parents | 01594b0c86e2 |
children | acc40572da5b |
comparison
equal
deleted
inserted
replaced
6191:01594b0c86e2 | 6192:cd65a67aff31 |
---|---|
2769 | 2769 |
2770 commitopts2 = [ | 2770 commitopts2 = [ |
2771 ('d', 'date', '', _('record datecode as commit date')), | 2771 ('d', 'date', '', _('record datecode as commit date')), |
2772 ('u', 'user', '', _('record user as committer')), | 2772 ('u', 'user', '', _('record user as committer')), |
2773 ] | 2773 ] |
2774 | |
2775 templateopts = [ | |
2776 ('', 'style', '', _('display using template map file')), | |
2777 ('', 'template', '', _('display with template')), | |
2778 ] | |
2779 | |
2780 logopts = [ | |
2781 ('p', 'patch', None, _('show patch')), | |
2782 ('l', 'limit', '', _('limit number of changes displayed')), | |
2783 ('M', 'no-merges', None, _('do not show merges')), | |
2784 ] + templateopts | |
2774 | 2785 |
2775 table = { | 2786 table = { |
2776 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), | 2787 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), |
2777 "addremove": | 2788 "addremove": |
2778 (addremove, | 2789 (addremove, |
2946 ('d', 'date', None, _('list the date (short with -q)')), | 2957 ('d', 'date', None, _('list the date (short with -q)')), |
2947 ] + walkopts, | 2958 ] + walkopts, |
2948 _('hg grep [OPTION]... PATTERN [FILE]...')), | 2959 _('hg grep [OPTION]... PATTERN [FILE]...')), |
2949 "heads": | 2960 "heads": |
2950 (heads, | 2961 (heads, |
2951 [('', 'style', '', _('display using template map file')), | 2962 [('r', 'rev', '', _('show only heads which are descendants of rev')), |
2952 ('r', 'rev', '', _('show only heads which are descendants of rev')), | 2963 ] + templateopts, |
2953 ('', 'template', '', _('display with template'))], | |
2954 _('hg heads [-r REV] [REV]...')), | 2964 _('hg heads [-r REV] [REV]...')), |
2955 "help": (help_, [], _('hg help [COMMAND]')), | 2965 "help": (help_, [], _('hg help [COMMAND]')), |
2956 "identify|id": | 2966 "identify|id": |
2957 (identify, | 2967 (identify, |
2958 [('r', 'rev', '', _('identify the specified rev')), | 2968 [('r', 'rev', '', _('identify the specified rev')), |
2976 _('Use any branch information in patch (implied by --exact)'))] + | 2986 _('Use any branch information in patch (implied by --exact)'))] + |
2977 commitopts + commitopts2, | 2987 commitopts + commitopts2, |
2978 _('hg import [OPTION]... PATCH...')), | 2988 _('hg import [OPTION]... PATCH...')), |
2979 "incoming|in": | 2989 "incoming|in": |
2980 (incoming, | 2990 (incoming, |
2981 [('M', 'no-merges', None, _('do not show merges')), | 2991 [('f', 'force', None, |
2982 ('f', 'force', None, | |
2983 _('run even when remote repository is unrelated')), | 2992 _('run even when remote repository is unrelated')), |
2984 ('', 'style', '', _('display using template map file')), | |
2985 ('n', 'newest-first', None, _('show newest record first')), | 2993 ('n', 'newest-first', None, _('show newest record first')), |
2986 ('', 'bundle', '', _('file to store the bundles into')), | 2994 ('', 'bundle', '', _('file to store the bundles into')), |
2987 ('p', 'patch', None, _('show patch')), | |
2988 ('l', 'limit', '', _('limit number of changes displayed')), | |
2989 ('r', 'rev', [], _('a specific revision up to which you would like to pull')), | 2995 ('r', 'rev', [], _('a specific revision up to which you would like to pull')), |
2990 ('', 'template', '', _('display with template')), | 2996 ] + logopts + remoteopts, |
2991 ] + remoteopts, | |
2992 _('hg incoming [-p] [-n] [-M] [-f] [-r REV]...' | 2997 _('hg incoming [-p] [-n] [-M] [-f] [-r REV]...' |
2993 ' [--bundle FILENAME] [SOURCE]')), | 2998 ' [--bundle FILENAME] [SOURCE]')), |
2994 "^init": | 2999 "^init": |
2995 (init, | 3000 (init, |
2996 remoteopts, | 3001 remoteopts, |
3011 ('', 'follow-first', None, | 3016 ('', 'follow-first', None, |
3012 _('only follow the first parent of merge changesets')), | 3017 _('only follow the first parent of merge changesets')), |
3013 ('d', 'date', '', _('show revs matching date spec')), | 3018 ('d', 'date', '', _('show revs matching date spec')), |
3014 ('C', 'copies', None, _('show copied files')), | 3019 ('C', 'copies', None, _('show copied files')), |
3015 ('k', 'keyword', [], _('do case-insensitive search for a keyword')), | 3020 ('k', 'keyword', [], _('do case-insensitive search for a keyword')), |
3016 ('l', 'limit', '', _('limit number of changes displayed')), | |
3017 ('r', 'rev', [], _('show the specified revision or range')), | 3021 ('r', 'rev', [], _('show the specified revision or range')), |
3018 ('', 'removed', None, _('include revs where files were removed')), | 3022 ('', 'removed', None, _('include revs where files were removed')), |
3019 ('M', 'no-merges', None, _('do not show merges')), | |
3020 ('', 'style', '', _('display using template map file')), | |
3021 ('m', 'only-merges', None, _('show only merges')), | 3023 ('m', 'only-merges', None, _('show only merges')), |
3022 ('b', 'only-branch', [], | 3024 ('b', 'only-branch', [], |
3023 _('show only changesets within the given named branch')), | 3025 _('show only changesets within the given named branch')), |
3024 ('p', 'patch', None, _('show patch')), | |
3025 ('P', 'prune', [], _('do not display revision or any of its ancestors')), | 3026 ('P', 'prune', [], _('do not display revision or any of its ancestors')), |
3026 ('', 'template', '', _('display with template')), | 3027 ] + logopts + walkopts, |
3027 ] + walkopts, | |
3028 _('hg log [OPTION]... [FILE]')), | 3028 _('hg log [OPTION]... [FILE]')), |
3029 "manifest": | 3029 "manifest": |
3030 (manifest, | 3030 (manifest, |
3031 [('r', 'rev', '', _('revision to display'))], | 3031 [('r', 'rev', '', _('revision to display'))], |
3032 _('hg manifest [-r REV]')), | 3032 _('hg manifest [-r REV]')), |
3036 ('r', 'rev', '', _('revision to merge')), | 3036 ('r', 'rev', '', _('revision to merge')), |
3037 ], | 3037 ], |
3038 _('hg merge [-f] [[-r] REV]')), | 3038 _('hg merge [-f] [[-r] REV]')), |
3039 "outgoing|out": | 3039 "outgoing|out": |
3040 (outgoing, | 3040 (outgoing, |
3041 [('M', 'no-merges', None, _('do not show merges')), | 3041 [('f', 'force', None, |
3042 ('f', 'force', None, | |
3043 _('run even when remote repository is unrelated')), | 3042 _('run even when remote repository is unrelated')), |
3044 ('p', 'patch', None, _('show patch')), | |
3045 ('', 'style', '', _('display using template map file')), | |
3046 ('l', 'limit', '', _('limit number of changes displayed')), | |
3047 ('r', 'rev', [], _('a specific revision you would like to push')), | 3043 ('r', 'rev', [], _('a specific revision you would like to push')), |
3048 ('n', 'newest-first', None, _('show newest record first')), | 3044 ('n', 'newest-first', None, _('show newest record first')), |
3049 ('', 'template', '', _('display with template')), | 3045 ] + logopts + remoteopts, |
3050 ] + remoteopts, | |
3051 _('hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]')), | 3046 _('hg outgoing [-M] [-p] [-n] [-f] [-r REV]... [DEST]')), |
3052 "^parents": | 3047 "^parents": |
3053 (parents, | 3048 (parents, |
3054 [('r', 'rev', '', _('show parents from the specified rev')), | 3049 [('r', 'rev', '', _('show parents from the specified rev')), |
3055 ('', 'style', '', _('display using template map file')), | 3050 ] + templateopts, |
3056 ('', 'template', '', _('display with template'))], | |
3057 _('hg parents [-r REV] [FILE]')), | 3051 _('hg parents [-r REV] [FILE]')), |
3058 "paths": (paths, [], _('hg paths [NAME]')), | 3052 "paths": (paths, [], _('hg paths [NAME]')), |
3059 "^pull": | 3053 "^pull": |
3060 (pull, | 3054 (pull, |
3061 [('u', 'update', None, | 3055 [('u', 'update', None, |
3148 ] + commitopts2, | 3142 ] + commitopts2, |
3149 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), | 3143 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')), |
3150 "tags": (tags, [], _('hg tags')), | 3144 "tags": (tags, [], _('hg tags')), |
3151 "tip": | 3145 "tip": |
3152 (tip, | 3146 (tip, |
3153 [('', 'style', '', _('display using template map file')), | 3147 [('p', 'patch', None, _('show patch')), |
3154 ('p', 'patch', None, _('show patch')), | 3148 ] + templateopts, |
3155 ('', 'template', '', _('display with template'))], | |
3156 _('hg tip [-p]')), | 3149 _('hg tip [-p]')), |
3157 "unbundle": | 3150 "unbundle": |
3158 (unbundle, | 3151 (unbundle, |
3159 [('u', 'update', None, | 3152 [('u', 'update', None, |
3160 _('update to new tip if changesets were unbundled'))], | 3153 _('update to new tip if changesets were unbundled'))], |