comparison hgext/patchbomb.py @ 13198:e71b2aa74ce3

patchbomb: save introductory message in .hg/last-email.txt
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Tue, 21 Dec 2010 19:44:28 +0900
parents d85e30889f26
children 14f3795a5ed7
comparison
equal deleted inserted replaced
13197:684a977c2ae0 13198:e71b2aa74ce3
191 an introductory message describing the patches of your patchbomb. 191 an introductory message describing the patches of your patchbomb.
192 Then when all is done, patchbomb messages are displayed. If the 192 Then when all is done, patchbomb messages are displayed. If the
193 PAGER environment variable is set, your pager will be fired up once 193 PAGER environment variable is set, your pager will be fired up once
194 for each patchbomb message, so you can verify everything is alright. 194 for each patchbomb message, so you can verify everything is alright.
195 195
196 In case email sending fails, you will find a backup of your series
197 introductory message in ``.hg/last-email.txt``.
198
196 Examples:: 199 Examples::
197 200
198 hg email -r 3000 # send patch 3000 only 201 hg email -r 3000 # send patch 3000 only
199 hg email -r 3000 -r 3001 # send patches 3000 and 3001 202 hg email -r 3000 -r 3001 # send patches 3000 and 3001
200 hg email -r 3000:3005 # send patches 3000 through 3005 203 hg email -r 3000:3005 # send patches 3000 through 3005
307 body = open(opts.get('desc')).read() 310 body = open(opts.get('desc')).read()
308 else: 311 else:
309 ui.write(_('\nWrite the introductory message for the ' 312 ui.write(_('\nWrite the introductory message for the '
310 'patch series.\n\n')) 313 'patch series.\n\n'))
311 body = ui.edit(body, sender) 314 body = ui.edit(body, sender)
315 # Save serie description in case sendmail fails
316 msgfile = repo.opener('last-email.txt', 'wb')
317 msgfile.write(body)
318 msgfile.close()
312 return body 319 return body
313 320
314 def getpatchmsgs(patches, patchnames=None): 321 def getpatchmsgs(patches, patchnames=None):
315 jumbo = [] 322 jumbo = []
316 msgs = [] 323 msgs = []