comparison hgext/patchbomb.py @ 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 bd9c39e8f38b
children 030d0abdf91b
comparison
equal deleted inserted replaced
2703:d32b31e88391 2704:99e7cf6bd2f7
186 cc = getaddrs('cc', 'Cc', '') 186 cc = getaddrs('cc', 'Cc', '')
187 187
188 if len(patches) > 1: 188 if len(patches) > 1:
189 ui.write(_('\nWrite the introductory message for the patch series.\n\n')) 189 ui.write(_('\nWrite the introductory message for the patch series.\n\n'))
190 190
191 msg = email.MIMEMultipart.MIMEMultipart() 191 subj = '[PATCH 0 of %d] %s' % (
192 msg['Subject'] = '[PATCH 0 of %d] %s' % (
193 len(patches), 192 len(patches),
194 opts['subject'] or 193 opts['subject'] or
195 prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches))) 194 prompt('Subject:', rest = ' [PATCH 0 of %d] ' % len(patches)))
196 195
197 ui.write(_('Finish with ^D or a dot on a line by itself.\n\n')) 196 ui.write(_('Finish with ^D or a dot on a line by itself.\n\n'))
202 try: l = raw_input() 201 try: l = raw_input()
203 except EOFError: break 202 except EOFError: break
204 if l == '.': break 203 if l == '.': break
205 body.append(l) 204 body.append(l)
206 205
207 msg.attach(email.MIMEText.MIMEText('\n'.join(body) + '\n'))
208
209 if opts['diffstat']: 206 if opts['diffstat']:
210 d = cdiffstat(_('Final summary:\n'), jumbo) 207 d = cdiffstat(_('Final summary:\n'), jumbo)
211 if d: msg.attach(email.MIMEText.MIMEText(d)) 208 if d: body.append('\n' + d)
209
210 body = '\n'.join(body) + '\n'
211
212 msg = email.MIMEText.MIMEText(body)
213 msg['Subject'] = subj
212 214
213 msgs.insert(0, msg) 215 msgs.insert(0, msg)
214 216
215 ui.write('\n') 217 ui.write('\n')
216 218