comparison contrib/patchbomb @ 1604:da3f1121721b

add --plain option to patchbomb. this omits the hg patch headers. it makes a patchbomb email look like a regular email with a patch.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 28 Dec 2005 07:13:52 -0800
parents 5352a5407dc1
children
comparison
equal deleted inserted replaced
1603:5352a5407dc1 1604:da3f1121721b
126 126
127 #body = ('\n'.join(desc[1:]).strip() or 127 #body = ('\n'.join(desc[1:]).strip() or
128 # 'Patch subject is complete summary.') 128 # 'Patch subject is complete summary.')
129 #body += '\n\n\n' 129 #body += '\n\n\n'
130 130
131 if opts['plain']:
132 while patch and patch[0].startswith('# '): patch.pop(0)
133 if patch: patch.pop(0)
134 while patch and not patch[0].strip(): patch.pop(0)
131 if opts['diffstat']: 135 if opts['diffstat']:
132 body += cdiffstat('\n'.join(desc), patch) + '\n\n' 136 body += cdiffstat('\n'.join(desc), patch) + '\n\n'
133 body += '\n'.join(patch) 137 body += '\n'.join(patch)
134 msg = MIMEText(body) 138 msg = MIMEText(body)
135 subj = '[PATCH %d of %d] %s' % (idx, total, desc[0].strip()) 139 subj = '[PATCH %d of %d] %s' % (idx, total, desc[0].strip())
250 254
251 if __name__ == '__main__': 255 if __name__ == '__main__':
252 optspec = [('c', 'cc', [], 'email addresses of copy recipients'), 256 optspec = [('c', 'cc', [], 'email addresses of copy recipients'),
253 ('d', 'diffstat', None, 'add diffstat output to messages'), 257 ('d', 'diffstat', None, 'add diffstat output to messages'),
254 ('f', 'from', '', 'email address of sender'), 258 ('f', 'from', '', 'email address of sender'),
259 ('', 'plain', None, 'omit hg patch header'),
255 ('n', 'test', None, 'print messages that would be sent'), 260 ('n', 'test', None, 'print messages that would be sent'),
256 ('s', 'subject', '', 'subject of introductory message'), 261 ('s', 'subject', '', 'subject of introductory message'),
257 ('t', 'to', [], 'email addresses of recipients')] 262 ('t', 'to', [], 'email addresses of recipients')]
258 options = {} 263 options = {}
259 try: 264 try: