changeset 2704:99e7cf6bd2f7

make introductory message of patch series text/plain
author Christian Ebert <blacktrash@gmx.net>
date Thu, 27 Jul 2006 21:25:39 +0200
parents d32b31e88391
children 030d0abdf91b
files hgext/patchbomb.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/patchbomb.py	Fri Jul 21 01:51:17 2006 -0300
+++ b/hgext/patchbomb.py	Thu Jul 27 21:25:39 2006 +0200
@@ -188,8 +188,7 @@
     if len(patches) > 1:
         ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
 
-        msg = email.MIMEMultipart.MIMEMultipart()
-        msg['Subject'] = '[PATCH 0 of %d] %s' % (
+        subj = '[PATCH 0 of %d] %s' % (
             len(patches),
             opts['subject'] or
             prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches)))
@@ -204,11 +203,14 @@
             if l == '.': break
             body.append(l)
 
-        msg.attach(email.MIMEText.MIMEText('\n'.join(body) + '\n'))
-
         if opts['diffstat']:
             d = cdiffstat(_('Final summary:\n'), jumbo)
-            if d: msg.attach(email.MIMEText.MIMEText(d))
+            if d: body.append('\n' + d)
+
+        body = '\n'.join(body) + '\n'
+
+        msg = email.MIMEText.MIMEText(body)
+        msg['Subject'] = subj
 
         msgs.insert(0, msg)