1770 hgpatch = True |
1770 hgpatch = True |
1771 message = [] # We may have collected garbage |
1771 message = [] # We may have collected garbage |
1772 elif message or line: |
1772 elif message or line: |
1773 message.append(line) |
1773 message.append(line) |
1774 |
1774 |
1775 # make sure message isn't empty |
1775 if opts['message']: |
1776 if not message: |
1776 # pickup the cmdline msg |
1777 message = _("imported patch %s\n") % patch |
1777 message = opts['message'] |
|
1778 elif message: |
|
1779 # pickup the patch msg |
|
1780 message = '\n'.join(message).rstrip() |
1778 else: |
1781 else: |
1779 message = '\n'.join(message).rstrip() |
1782 # launch the editor |
|
1783 message = None |
1780 ui.debug(_('message:\n%s\n') % message) |
1784 ui.debug(_('message:\n%s\n') % message) |
1781 |
1785 |
1782 if tmpfp: tmpfp.close() |
1786 if tmpfp: tmpfp.close() |
1783 files = util.patch(strip, pf, ui) |
1787 files = util.patch(strip, pf, ui) |
1784 |
1788 |
2958 "import|patch": |
2962 "import|patch": |
2959 (import_, |
2963 (import_, |
2960 [('p', 'strip', 1, |
2964 [('p', 'strip', 1, |
2961 _('directory strip option for patch. This has the same\n' |
2965 _('directory strip option for patch. This has the same\n' |
2962 'meaning as the corresponding patch option')), |
2966 'meaning as the corresponding patch option')), |
|
2967 ('m', 'message', '', _('use <text> as commit message')), |
2963 ('b', 'base', '', _('base path')), |
2968 ('b', 'base', '', _('base path')), |
2964 ('f', 'force', None, |
2969 ('f', 'force', None, |
2965 _('skip check for outstanding uncommitted changes'))], |
2970 _('skip check for outstanding uncommitted changes'))], |
2966 _('hg import [-p NUM] [-b BASE] [-f] PATCH...')), |
2971 _('hg import [-p NUM] [-b BASE] [-m MESSAGE] [-f] PATCH...')), |
2967 "incoming|in": (incoming, |
2972 "incoming|in": (incoming, |
2968 [('M', 'no-merges', None, _('do not show merges')), |
2973 [('M', 'no-merges', None, _('do not show merges')), |
2969 ('f', 'force', None, |
2974 ('f', 'force', None, |
2970 _('run even when remote repository is unrelated')), |
2975 _('run even when remote repository is unrelated')), |
2971 ('', 'style', '', _('display using template map file')), |
2976 ('', 'style', '', _('display using template map file')), |