##// END OF EJS Templates
refactor options from cmdtable...
Benoit Boissinot -
r5147:c80af969 default
parent child Browse files
Show More
@@ -50,7 +50,7 b''
50
50
51 from mercurial.i18n import _
51 from mercurial.i18n import _
52 from mercurial.node import *
52 from mercurial.node import *
53 from mercurial import cmdutil, util
53 from mercurial import cmdutil, util, commands
54 import os, shutil, tempfile
54 import os, shutil, tempfile
55
55
56
56
@@ -181,8 +181,7 b' cmdtable = {'
181 [('p', 'program', '', _('comparison program to run')),
181 [('p', 'program', '', _('comparison program to run')),
182 ('o', 'option', [], _('pass option to comparison program')),
182 ('o', 'option', [], _('pass option to comparison program')),
183 ('r', 'rev', [], _('revision')),
183 ('r', 'rev', [], _('revision')),
184 ('I', 'include', [], _('include names matching the given patterns')),
184 ] + commands.walkopts,
185 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
186 _('hg extdiff [OPT]... [FILE]...')),
185 _('hg extdiff [OPT]... [FILE]...')),
187 }
186 }
188
187
@@ -86,13 +86,8 b" def fetch(ui, repo, source='default', **"
86 cmdtable = {
86 cmdtable = {
87 'fetch':
87 'fetch':
88 (fetch,
88 (fetch,
89 [('e', 'ssh', '', _('specify ssh command to use')),
89 [('r', 'rev', [], _('a specific revision you would like to pull')),
90 ('m', 'message', '', _('use <text> as commit message')),
91 ('l', 'logfile', '', _('read the commit message from <file>')),
92 ('d', 'date', '', _('record datecode as commit date')),
93 ('u', 'user', '', _('record user as commiter')),
94 ('r', 'rev', [], _('a specific revision you would like to pull')),
95 ('f', 'force-editor', None, _('edit commit message')),
90 ('f', 'force-editor', None, _('edit commit message')),
96 ('', 'remotecmd', '', _('hg command to run on the remote side'))],
91 ] + commands.commitopts + commands.commitopts2 + commands.remoteopts,
97 _('hg fetch [SOURCE]')),
92 _('hg fetch [SOURCE]')),
98 }
93 }
@@ -6,7 +6,7 b''
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 import os, tempfile, binascii
8 import os, tempfile, binascii
9 from mercurial import util
9 from mercurial import util, commands
10 from mercurial import node as hgnode
10 from mercurial import node as hgnode
11 from mercurial.i18n import _
11 from mercurial.i18n import _
12
12
@@ -269,10 +269,9 b' cmdtable = {'
269 [('l', 'local', None, _('make the signature local')),
269 [('l', 'local', None, _('make the signature local')),
270 ('f', 'force', None, _('sign even if the sigfile is modified')),
270 ('f', 'force', None, _('sign even if the sigfile is modified')),
271 ('', 'no-commit', None, _('do not commit the sigfile after signing')),
271 ('', 'no-commit', None, _('do not commit the sigfile after signing')),
272 ('k', 'key', '', _('the key id to sign with')),
272 ('m', 'message', '', _('commit message')),
273 ('m', 'message', '', _('commit message')),
273 ('d', 'date', '', _('date code')),
274 ] + commands.commitopts2,
274 ('u', 'user', '', _('user')),
275 ('k', 'key', '', _('the key id to sign with'))],
276 _('hg sign [OPTION]... [REVISION]...')),
275 _('hg sign [OPTION]... [REVISION]...')),
277 "sigcheck": (check, [], _('hg sigcheck REVISION')),
276 "sigcheck": (check, [], _('hg sigcheck REVISION')),
278 "sigs": (sigs, [], _('hg sigs')),
277 "sigs": (sigs, [], _('hg sigs')),
@@ -2131,10 +2131,8 b' cmdtable = {'
2131 ('U', 'noupdate', None, _('do not update the new working directories')),
2131 ('U', 'noupdate', None, _('do not update the new working directories')),
2132 ('', 'uncompressed', None,
2132 ('', 'uncompressed', None,
2133 _('use uncompressed transfer (fast over LAN)')),
2133 _('use uncompressed transfer (fast over LAN)')),
2134 ('e', 'ssh', '', _('specify ssh command to use')),
2135 ('p', 'patches', '', _('location of source patch repo')),
2134 ('p', 'patches', '', _('location of source patch repo')),
2136 ('', 'remotecmd', '',
2135 ] + commands.remoteopts,
2137 _('specify hg command to run on the remote side'))],
2138 _('hg qclone [OPTION]... SOURCE [DEST]')),
2136 _('hg qclone [OPTION]... SOURCE [DEST]')),
2139 "qcommit|qci":
2137 "qcommit|qci":
2140 (commit,
2138 (commit,
@@ -2143,8 +2141,7 b' cmdtable = {'
2143 "^qdiff":
2141 "^qdiff":
2144 (diff,
2142 (diff,
2145 [('g', 'git', None, _('use git extended diff format')),
2143 [('g', 'git', None, _('use git extended diff format')),
2146 ('I', 'include', [], _('include names matching the given patterns')),
2144 ] + commands.walkopts,
2147 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
2148 _('hg qdiff [-I] [-X] [-g] [FILE]...')),
2145 _('hg qdiff [-I] [-X] [-g] [FILE]...')),
2149 "qdelete|qremove|qrm":
2146 "qdelete|qremove|qrm":
2150 (delete,
2147 (delete,
@@ -2184,9 +2181,7 b' cmdtable = {'
2184 [('e', 'edit', None, _('edit commit message')),
2181 [('e', 'edit', None, _('edit commit message')),
2185 ('f', 'force', None, _('import uncommitted changes into patch')),
2182 ('f', 'force', None, _('import uncommitted changes into patch')),
2186 ('g', 'git', None, _('use git extended diff format')),
2183 ('g', 'git', None, _('use git extended diff format')),
2187 ('I', 'include', [], _('include names matching the given patterns')),
2184 ] + commands.walkopts + commands.commitopts,
2188 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2189 ] + commands.commitopts,
2190 _('hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH [FILE]...')),
2185 _('hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH [FILE]...')),
2191 "qnext": (next, [] + seriesopts, _('hg qnext [-s]')),
2186 "qnext": (next, [] + seriesopts, _('hg qnext [-s]')),
2192 "qprev": (prev, [] + seriesopts, _('hg qprev [-s]')),
2187 "qprev": (prev, [] + seriesopts, _('hg qprev [-s]')),
@@ -2209,9 +2204,7 b' cmdtable = {'
2209 [('e', 'edit', None, _('edit commit message')),
2204 [('e', 'edit', None, _('edit commit message')),
2210 ('g', 'git', None, _('use git extended diff format')),
2205 ('g', 'git', None, _('use git extended diff format')),
2211 ('s', 'short', None, _('refresh only files already in the patch')),
2206 ('s', 'short', None, _('refresh only files already in the patch')),
2212 ('I', 'include', [], _('include names matching the given patterns')),
2207 ] + commands.walkopts + commands.commitopts,
2213 ('X', 'exclude', [], _('exclude names matching the given patterns')),
2214 ] + commands.commitopts,
2215 _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...')),
2208 _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...')),
2216 'qrename|qmv':
2209 'qrename|qmv':
2217 (rename, [], _('hg qrename PATCH1 [PATCH2]')),
2210 (rename, [], _('hg qrename PATCH1 [PATCH2]')),
@@ -27,7 +27,7 b''
27 # along with this program; if not, write to the Free Software
27 # along with this program; if not, write to the Free Software
28 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29
29
30 from mercurial import hg, util
30 from mercurial import hg, util, commands
31 from mercurial.i18n import _
31 from mercurial.i18n import _
32 import os
32 import os
33
33
@@ -162,7 +162,6 b' cmdtable = {'
162 ('p', 'print', None, _('print the file names instead of deleting them')),
162 ('p', 'print', None, _('print the file names instead of deleting them')),
163 ('0', 'print0', None, _('end filenames with NUL, for use with xargs'
163 ('0', 'print0', None, _('end filenames with NUL, for use with xargs'
164 ' (implies -p)')),
164 ' (implies -p)')),
165 ('I', 'include', [], _('include names matching the given patterns')),
165 ] + commands.walkopts,
166 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
167 _('hg purge [OPTION]... [DIR]...'))
166 _('hg purge [OPTION]... [DIR]...'))
168 }
167 }
@@ -375,8 +375,6 b' cmdtable = {'
375 (record,
375 (record,
376 [('A', 'addremove', None,
376 [('A', 'addremove', None,
377 _('mark new/missing files as added/removed before committing')),
377 _('mark new/missing files as added/removed before committing')),
378 ('d', 'date', '', _('record datecode as commit date')),
378 ] + commands.walkopts + commands.commitopts + commands.commitopts2,
379 ('u', 'user', '', _('record user as commiter')),
380 ] + commands.walkopts + commands.commitopts,
381 _('hg record [OPTION]... [FILE]...')),
379 _('hg record [OPTION]... [FILE]...')),
382 }
380 }
@@ -2751,6 +2751,11 b' commitopts = ['
2751 ('l', 'logfile', '', _('read commit message from <file>')),
2751 ('l', 'logfile', '', _('read commit message from <file>')),
2752 ]
2752 ]
2753
2753
2754 commitopts2 = [
2755 ('d', 'date', '', _('record datecode as commit date')),
2756 ('u', 'user', '', _('record user as committer')),
2757 ]
2758
2754 table = {
2759 table = {
2755 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')),
2760 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')),
2756 "addremove":
2761 "addremove":
@@ -2784,11 +2789,9 b' table = {'
2784 (backout,
2789 (backout,
2785 [('', 'merge', None,
2790 [('', 'merge', None,
2786 _('merge with old dirstate parent after backout')),
2791 _('merge with old dirstate parent after backout')),
2787 ('d', 'date', '', _('record datecode as commit date')),
2788 ('', 'parent', '', _('parent to choose when backing out merge')),
2792 ('', 'parent', '', _('parent to choose when backing out merge')),
2789 ('u', 'user', '', _('record user as committer')),
2790 ('r', 'rev', '', _('revision to backout')),
2793 ('r', 'rev', '', _('revision to backout')),
2791 ] + walkopts + commitopts,
2794 ] + walkopts + commitopts + commitopts2,
2792 _('hg backout [OPTION]... [-r] REV')),
2795 _('hg backout [OPTION]... [-r] REV')),
2793 "branch":
2796 "branch":
2794 (branch,
2797 (branch,
@@ -2830,9 +2833,7 b' table = {'
2830 (commit,
2833 (commit,
2831 [('A', 'addremove', None,
2834 [('A', 'addremove', None,
2832 _('mark new/missing files as added/removed before committing')),
2835 _('mark new/missing files as added/removed before committing')),
2833 ('d', 'date', '', _('record datecode as commit date')),
2836 ] + walkopts + commitopts + commitopts2,
2834 ('u', 'user', '', _('record user as commiter')),
2835 ] + walkopts + commitopts,
2836 _('hg commit [OPTION]... [FILE]...')),
2837 _('hg commit [OPTION]... [FILE]...')),
2837 "copy|cp":
2838 "copy|cp":
2838 (copy,
2839 (copy,
@@ -3022,10 +3023,8 b' table = {'
3022 "debugrawcommit|rawcommit":
3023 "debugrawcommit|rawcommit":
3023 (rawcommit,
3024 (rawcommit,
3024 [('p', 'parent', [], _('parent')),
3025 [('p', 'parent', [], _('parent')),
3025 ('d', 'date', '', _('date code')),
3026 ('u', 'user', '', _('user')),
3027 ('F', 'files', '', _('file list'))
3026 ('F', 'files', '', _('file list'))
3028 ] + commitopts,
3027 ] + commitopts + commitopts2,
3029 _('hg debugrawcommit [OPTION]... [FILE]...')),
3028 _('hg debugrawcommit [OPTION]... [FILE]...')),
3030 "recover": (recover, [], _('hg recover')),
3029 "recover": (recover, [], _('hg recover')),
3031 "^remove|rm":
3030 "^remove|rm":
@@ -3095,11 +3094,11 b' table = {'
3095 (tag,
3094 (tag,
3096 [('f', 'force', None, _('replace existing tag')),
3095 [('f', 'force', None, _('replace existing tag')),
3097 ('l', 'local', None, _('make the tag local')),
3096 ('l', 'local', None, _('make the tag local')),
3098 ('m', 'message', '', _('message for tag commit log entry')),
3099 ('d', 'date', '', _('record datecode as commit date')),
3100 ('u', 'user', '', _('record user as commiter')),
3101 ('r', 'rev', '', _('revision to tag')),
3097 ('r', 'rev', '', _('revision to tag')),
3102 ('', 'remove', None, _('remove a tag'))],
3098 ('', 'remove', None, _('remove a tag')),
3099 # -l/--local is already there, commitopts cannot be used
3100 ('m', 'message', '', _('use <text> as commit message')),
3101 ] + commitopts2,
3103 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
3102 _('hg tag [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME')),
3104 "tags": (tags, [], _('hg tags')),
3103 "tags": (tags, [], _('hg tags')),
3105 "tip":
3104 "tip":
@@ -6,12 +6,12 b' interactively select changes to commit'
6 options:
6 options:
7
7
8 -A --addremove mark new/missing files as added/removed before committing
8 -A --addremove mark new/missing files as added/removed before committing
9 -d --date record datecode as commit date
10 -u --user record user as commiter
11 -I --include include names matching the given patterns
9 -I --include include names matching the given patterns
12 -X --exclude exclude names matching the given patterns
10 -X --exclude exclude names matching the given patterns
13 -m --message use <text> as commit message
11 -m --message use <text> as commit message
14 -l --logfile read commit message from <file>
12 -l --logfile read commit message from <file>
13 -d --date record datecode as commit date
14 -u --user record user as committer
15
15
16 use "hg -v help record" to show global options
16 use "hg -v help record" to show global options
17 % select no files
17 % select no files
General Comments 0
You need to be logged in to leave comments. Login now