[PATCH] patchbomb: use ui.edit to compose summary mail
Brendan Cully
brendan at kublai.com
Wed Dec 13 18:48:56 UTC 2006
# HG changeset patch
# User Brendan Cully <brendan at kublai.com>
# Date 1166039330 28800
# Node ID 8a838d7fec6264e8e9a7c51cf8898c88f9cca887
# Parent 729f354f3f09eb3c6e976eeef17f5a2fa9cd30d1
patchbomb: use ui.edit to compose summary mail
diff -r 729f354f3f09 -r 8a838d7fec62 hgext/patchbomb.py
--- a/hgext/patchbomb.py Tue Dec 12 15:34:11 2006 -0600
+++ b/hgext/patchbomb.py Wed Dec 13 11:48:50 2006 -0800
@@ -216,8 +216,6 @@ def patchbomb(ui, repo, *revs, **opts):
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,12 @@ def patchbomb(ui, repo, *revs, **opts):
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)
-
if opts['diffstat']:
d = cdiffstat(_('Final summary:\n'), jumbo)
- if d: body.append('\n' + d)
-
- body = '\n'.join(body) + '\n'
+ if d: body = '\n' + d
+
+ 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
More information about the Mercurial-devel
mailing list