# HG changeset patch # User Mathieu Clabaut # Date 1164062241 -3600 # Node ID f6f16f87104953d2f9b42676960e112e36f91afa # Parent f9e129684b5d6a72f823ee4a4c39a9735144f673 Uniformisation of commit help for -m and -l. Addition of the -m and -l options for hg import. 'hg tag' still lacks the --logfile option which short form conflicts with its --local option. diff -r f9e129684b5d -r f6f16f871049 hgext/mq.py --- a/hgext/mq.py Sun Dec 10 14:39:51 2006 +0100 +++ b/hgext/mq.py Mon Nov 20 23:37:21 2006 +0100 @@ -2103,9 +2103,8 @@ 'qfold': (fold, [('e', 'edit', None, _('edit patch header')), - ('k', 'keep', None, _('keep folded patch files')), - ('m', 'message', '', _('set patch header to ')), - ('l', 'logfile', '', _('set patch header to contents of '))], + ('k', 'keep', None, _('keep folded patch files')) + ] + commands.commitopts, 'hg qfold [-e] [-m ] [-l as commit message')), - ('l', 'logfile', '', _('read the commit message from ')), - ('f', 'force', None, _('import uncommitted changes into patch'))], + ('f', 'force', None, _('import uncommitted changes into patch')) + ] + commands.commitopts, 'hg qnew [-e] [-m TEXT] [-l FILE] [-f] PATCH'), "qnext": (next, [] + seriesopts, 'hg qnext [-s]'), "qprev": (prev, [] + seriesopts, 'hg qprev [-s]'), @@ -2150,12 +2148,11 @@ "^qrefresh": (refresh, [('e', 'edit', None, _('edit commit message')), - ('m', 'message', '', _('change commit message to ')), - ('l', 'logfile', '', _('change commit message to content')), ('g', 'git', None, _('use git extended diff format')), ('s', 'short', None, 'refresh only files already in the patch'), ('I', 'include', [], _('include names matching the given patterns')), - ('X', 'exclude', [], _('exclude names matching the given patterns'))], + ('X', 'exclude', [], _('exclude names matching the given patterns')) + ] + commands.commitopts, 'hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] FILES...'), 'qrename|qmv': (rename, [], 'hg qrename PATCH1 [PATCH2]'), @@ -2166,12 +2163,10 @@ 'hg qrestore [-d] [-u] REV'), "qsave": (save, - [('m', 'message', '', _('use as commit message')), - ('l', 'logfile', '', _('read the commit message from ')), - ('c', 'copy', None, 'copy patch directory'), + [('c', 'copy', None, 'copy patch directory'), ('n', 'name', '', 'copy directory name'), ('e', 'empty', None, 'clear queue status file'), - ('f', 'force', None, 'force copy')], + ('f', 'force', None, 'force copy')] + commands.commitopts, 'hg qsave [-m TEXT] [-l FILE] [-c] [-n NAME] [-e] [-f]'), "qselect": (select, [('n', 'none', None, _('disable all guards')), diff -r f9e129684b5d -r f6f16f871049 mercurial/commands.py --- a/mercurial/commands.py Sun Dec 10 14:39:51 2006 +0100 +++ b/mercurial/commands.py Mon Nov 20 23:37:21 2006 +0100 @@ -1492,9 +1492,10 @@ raise util.Abort(_('no diffs found')) try: - if opts['message']: + cmdline_message = logmessage(opts) + if cmdline_message: # pickup the cmdline msg - message = opts['message'] + message = cmdline_message elif message: # pickup the patch msg message = message.strip() @@ -2586,6 +2587,11 @@ ('X', 'exclude', [], _('exclude names matching the given patterns')), ] +commitopts = [ + ('m', 'message', '', _('use as commit message')), + ('l', 'logfile', '', _('read commit message from ')), +] + table = { "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), "addremove": @@ -2617,12 +2623,10 @@ (backout, [('', 'merge', None, _('merge with old dirstate parent after backout')), - ('m', 'message', '', _('use as commit message')), - ('l', 'logfile', '', _('read commit message from ')), ('d', 'date', '', _('record datecode as commit date')), ('', 'parent', '', _('parent to choose when backing out merge')), ('u', 'user', '', _('record user as committer')), - ] + walkopts, + ] + walkopts + commitopts, _('hg backout [OPTION]... REV')), "branch": (branch, [], _('hg branch [NAME]')), "branches": (branches, [], _('hg branches')), @@ -2656,11 +2660,9 @@ (commit, [('A', 'addremove', None, _('mark new/missing files as added/removed before committing')), - ('m', 'message', '', _('use as commit message')), - ('l', 'logfile', '', _('read the commit message from ')), ('d', 'date', '', _('record datecode as commit date')), ('u', 'user', '', _('record user as commiter')), - ] + walkopts, + ] + walkopts + commitopts, _('hg commit [OPTION]... [FILE]...')), "copy|cp": (copy, @@ -2743,10 +2745,9 @@ [('p', 'strip', 1, _('directory strip option for patch. This has the same\n' 'meaning as the corresponding patch option')), - ('m', 'message', '', _('use as commit message')), ('b', 'base', '', _('base path (DEPRECATED)')), ('f', 'force', None, - _('skip check for outstanding uncommitted changes'))], + _('skip check for outstanding uncommitted changes'))] + commitopts, _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), "incoming|in": (incoming, [('M', 'no-merges', None, _('do not show merges')), @@ -2838,9 +2839,8 @@ [('p', 'parent', [], _('parent')), ('d', 'date', '', _('date code')), ('u', 'user', '', _('user')), - ('F', 'files', '', _('file list')), - ('m', 'message', '', _('commit message')), - ('l', 'logfile', '', _('commit message file'))], + ('F', 'files', '', _('file list')) + ] + commitopts, _('hg debugrawcommit [OPTION]... [FILE]...')), "recover": (recover, [], _('hg recover')), "^remove|rm":