hgext/patchbomb.py
changeset 7360 42f1b8cb9a60
parent 7359 b0fa5dbd9cdd
child 7413 0b6428da1f22
--- a/hgext/patchbomb.py	Wed Nov 12 19:12:32 2008 +0100
+++ b/hgext/patchbomb.py	Thu Nov 13 10:11:32 2008 +0100
@@ -172,7 +172,7 @@
         msg = mail.mimetextpatch(body, display=opts.get('test'))
 
     subj = desc[0].strip().rstrip('. ')
-    if total == 1:
+    if total == 1 and not opts.get('intro'):
         subj = '[PATCH] ' + (opts.get('subject') or subj)
     else:
         tlen = len(str(total))
@@ -316,7 +316,7 @@
                             len(patches), name)
             msgs.append(msg)
 
-        if len(patches) > 1:
+        if len(patches) > 1 or opts.get('intro'):
             tlen = len(str(len(patches)))
 
             subj = '[PATCH %0*d of %d] %s' % (
@@ -481,6 +481,8 @@
            _('run even when remote repository is unrelated (with -b)')),
           ('', 'base', [],
            _('a base changeset to specify instead of a destination (with -b)')),
+          ('', 'intro', None,
+           _('send an introduction email for a single patch')),
          ] + emailopts + commands.remoteopts,
          _('hg email [OPTION]... [DEST]...'))
 }