change log message creation when using 'hg import'
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 18 Jun 2006 19:10:48 +0200
changeset 2458 9dd93deef3c9
parent 2451 134227b82a96
child 2459 5c5277f03887
change log message creation when using 'hg import' if found cmdline is used else if found patch header is used else launch hgeditor
mercurial/commands.py
--- 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,