patchbomb: use ui.edit to compose summary mail
authorBrendan Cully <brendan@kublai.com>
Wed, 13 Dec 2006 22:53:41 -0800
changeset 3879 ff49da8bd6ae
parent 3878 729f354f3f09
child 3881 59ec9c38f614
patchbomb: use ui.edit to compose summary mail
hgext/patchbomb.py
--- a/hgext/patchbomb.py	Tue Dec 12 15:34:11 2006 -0600
+++ b/hgext/patchbomb.py	Wed Dec 13 22:53:41 2006 -0800
@@ -216,8 +216,6 @@
     bcc = [a.strip() for a in bcc if a.strip()]
 
     if len(patches) > 1:
-        ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
-
         tlen = len(str(len(patches)))
 
         subj = '[PATCH %0*d of %d] %s' % (
@@ -227,21 +225,13 @@
             prompt('Subject:', rest = ' [PATCH %0*d of %d] ' % (tlen, 0,
                 len(patches))))
 
-        ui.write(_('Finish with ^D or a dot on a line by itself.\n\n'))
-
-        body = []
-
-        while True:
-            try: l = raw_input()
-            except EOFError: break
-            if l == '.': break
-            body.append(l)
-
+        body = ''
         if opts['diffstat']:
             d = cdiffstat(_('Final summary:\n'), jumbo)
-            if d: body.append('\n' + d)
+            if d: body = '\n' + d
 
-        body = '\n'.join(body) + '\n'
+        ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
+        body = ui.edit(body, sender)
 
         msg = email.MIMEText.MIMEText(body)
         msg['Subject'] = subj