changeset 2458:9dd93deef3c9

change log message creation when using 'hg import' if found cmdline is used else if found patch header is used else launch hgeditor
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sun, 18 Jun 2006 19:10:48 +0200
parents 134227b82a96
children 5c5277f03887
files mercurial/commands.py
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Jun 17 18:36:04 2006 +0200
+++ b/mercurial/commands.py	Sun Jun 18 19:10:48 2006 +0200
@@ -1772,11 +1772,15 @@
                 elif message or line:
                     message.append(line)
 
-            # make sure message isn't empty
-            if not message:
-                message = _("imported patch %s\n") % patch
+            if opts['message']:
+                # pickup the cmdline msg
+                message = opts['message']
+            elif message:
+                # pickup the patch msg
+                message = '\n'.join(message).rstrip()
             else:
-                message = '\n'.join(message).rstrip()
+                # launch the editor
+                message = None
             ui.debug(_('message:\n%s\n') % message)
 
             if tmpfp: tmpfp.close()
@@ -2960,10 +2964,11 @@
          [('p', 'strip', 1,
            _('directory strip option for patch. This has the same\n'
              'meaning as the corresponding patch option')),
+          ('m', 'message', '', _('use <text> as commit message')),
           ('b', 'base', '', _('base path')),
           ('f', 'force', None,
            _('skip check for outstanding uncommitted changes'))],
-         _('hg import [-p NUM] [-b BASE] [-f] PATCH...')),
+         _('hg import [-p NUM] [-b BASE] [-m MESSAGE] [-f] PATCH...')),
     "incoming|in": (incoming,
          [('M', 'no-merges', None, _('do not show merges')),
           ('f', 'force', None,