1490 |
1490 |
1491 if tmpname is None: |
1491 if tmpname is None: |
1492 raise util.Abort(_('no diffs found')) |
1492 raise util.Abort(_('no diffs found')) |
1493 |
1493 |
1494 try: |
1494 try: |
1495 if opts['message']: |
1495 cmdline_message = logmessage(opts) |
|
1496 if cmdline_message: |
1496 # pickup the cmdline msg |
1497 # pickup the cmdline msg |
1497 message = opts['message'] |
1498 message = cmdline_message |
1498 elif message: |
1499 elif message: |
1499 # pickup the patch msg |
1500 # pickup the patch msg |
1500 message = message.strip() |
1501 message = message.strip() |
1501 else: |
1502 else: |
1502 # launch the editor |
1503 # launch the editor |
2584 walkopts = [ |
2585 walkopts = [ |
2585 ('I', 'include', [], _('include names matching the given patterns')), |
2586 ('I', 'include', [], _('include names matching the given patterns')), |
2586 ('X', 'exclude', [], _('exclude names matching the given patterns')), |
2587 ('X', 'exclude', [], _('exclude names matching the given patterns')), |
2587 ] |
2588 ] |
2588 |
2589 |
|
2590 commitopts = [ |
|
2591 ('m', 'message', '', _('use <text> as commit message')), |
|
2592 ('l', 'logfile', '', _('read commit message from <file>')), |
|
2593 ] |
|
2594 |
2589 table = { |
2595 table = { |
2590 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), |
2596 "^add": (add, walkopts + dryrunopts, _('hg add [OPTION]... [FILE]...')), |
2591 "addremove": |
2597 "addremove": |
2592 (addremove, |
2598 (addremove, |
2593 [('s', 'similarity', '', |
2599 [('s', 'similarity', '', |
2615 _('hg archive [OPTION]... DEST')), |
2621 _('hg archive [OPTION]... DEST')), |
2616 "backout": |
2622 "backout": |
2617 (backout, |
2623 (backout, |
2618 [('', 'merge', None, |
2624 [('', 'merge', None, |
2619 _('merge with old dirstate parent after backout')), |
2625 _('merge with old dirstate parent after backout')), |
2620 ('m', 'message', '', _('use <text> as commit message')), |
|
2621 ('l', 'logfile', '', _('read commit message from <file>')), |
|
2622 ('d', 'date', '', _('record datecode as commit date')), |
2626 ('d', 'date', '', _('record datecode as commit date')), |
2623 ('', 'parent', '', _('parent to choose when backing out merge')), |
2627 ('', 'parent', '', _('parent to choose when backing out merge')), |
2624 ('u', 'user', '', _('record user as committer')), |
2628 ('u', 'user', '', _('record user as committer')), |
2625 ] + walkopts, |
2629 ] + walkopts + commitopts, |
2626 _('hg backout [OPTION]... REV')), |
2630 _('hg backout [OPTION]... REV')), |
2627 "branch": (branch, [], _('hg branch [NAME]')), |
2631 "branch": (branch, [], _('hg branch [NAME]')), |
2628 "branches": (branches, [], _('hg branches')), |
2632 "branches": (branches, [], _('hg branches')), |
2629 "bundle": |
2633 "bundle": |
2630 (bundle, |
2634 (bundle, |
2654 _('hg clone [OPTION]... SOURCE [DEST]')), |
2658 _('hg clone [OPTION]... SOURCE [DEST]')), |
2655 "^commit|ci": |
2659 "^commit|ci": |
2656 (commit, |
2660 (commit, |
2657 [('A', 'addremove', None, |
2661 [('A', 'addremove', None, |
2658 _('mark new/missing files as added/removed before committing')), |
2662 _('mark new/missing files as added/removed before committing')), |
2659 ('m', 'message', '', _('use <text> as commit message')), |
|
2660 ('l', 'logfile', '', _('read the commit message from <file>')), |
|
2661 ('d', 'date', '', _('record datecode as commit date')), |
2663 ('d', 'date', '', _('record datecode as commit date')), |
2662 ('u', 'user', '', _('record user as commiter')), |
2664 ('u', 'user', '', _('record user as commiter')), |
2663 ] + walkopts, |
2665 ] + walkopts + commitopts, |
2664 _('hg commit [OPTION]... [FILE]...')), |
2666 _('hg commit [OPTION]... [FILE]...')), |
2665 "copy|cp": |
2667 "copy|cp": |
2666 (copy, |
2668 (copy, |
2667 [('A', 'after', None, _('record a copy that has already occurred')), |
2669 [('A', 'after', None, _('record a copy that has already occurred')), |
2668 ('f', 'force', None, |
2670 ('f', 'force', None, |
2741 "import|patch": |
2743 "import|patch": |
2742 (import_, |
2744 (import_, |
2743 [('p', 'strip', 1, |
2745 [('p', 'strip', 1, |
2744 _('directory strip option for patch. This has the same\n' |
2746 _('directory strip option for patch. This has the same\n' |
2745 'meaning as the corresponding patch option')), |
2747 'meaning as the corresponding patch option')), |
2746 ('m', 'message', '', _('use <text> as commit message')), |
|
2747 ('b', 'base', '', _('base path (DEPRECATED)')), |
2748 ('b', 'base', '', _('base path (DEPRECATED)')), |
2748 ('f', 'force', None, |
2749 ('f', 'force', None, |
2749 _('skip check for outstanding uncommitted changes'))], |
2750 _('skip check for outstanding uncommitted changes'))] + commitopts, |
2750 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), |
2751 _('hg import [-p NUM] [-m MESSAGE] [-f] PATCH...')), |
2751 "incoming|in": (incoming, |
2752 "incoming|in": (incoming, |
2752 [('M', 'no-merges', None, _('do not show merges')), |
2753 [('M', 'no-merges', None, _('do not show merges')), |
2753 ('f', 'force', None, |
2754 ('f', 'force', None, |
2754 _('run even when remote repository is unrelated')), |
2755 _('run even when remote repository is unrelated')), |
2836 "debugrawcommit|rawcommit": |
2837 "debugrawcommit|rawcommit": |
2837 (rawcommit, |
2838 (rawcommit, |
2838 [('p', 'parent', [], _('parent')), |
2839 [('p', 'parent', [], _('parent')), |
2839 ('d', 'date', '', _('date code')), |
2840 ('d', 'date', '', _('date code')), |
2840 ('u', 'user', '', _('user')), |
2841 ('u', 'user', '', _('user')), |
2841 ('F', 'files', '', _('file list')), |
2842 ('F', 'files', '', _('file list')) |
2842 ('m', 'message', '', _('commit message')), |
2843 ] + commitopts, |
2843 ('l', 'logfile', '', _('commit message file'))], |
|
2844 _('hg debugrawcommit [OPTION]... [FILE]...')), |
2844 _('hg debugrawcommit [OPTION]... [FILE]...')), |
2845 "recover": (recover, [], _('hg recover')), |
2845 "recover": (recover, [], _('hg recover')), |
2846 "^remove|rm": |
2846 "^remove|rm": |
2847 (remove, |
2847 (remove, |
2848 [('A', 'after', None, _('record remove that has already occurred')), |
2848 [('A', 'after', None, _('record remove that has already occurred')), |