##// END OF EJS Templates
patchbomb: optionally send patches as inline attachments
Christian Ebert -
r2707:4af7b178 default
parent child Browse files
Show More
@@ -130,8 +130,13 b' def patchbomb(ui, repo, *revs, **opts):'
130 while patch and not patch[0].strip(): patch.pop(0)
130 while patch and not patch[0].strip(): patch.pop(0)
131 if opts['diffstat']:
131 if opts['diffstat']:
132 body += cdiffstat('\n'.join(desc), patch) + '\n\n'
132 body += cdiffstat('\n'.join(desc), patch) + '\n\n'
133 body += '\n'.join(patch)
133 if opts['attach']:
134 msg = email.MIMEText.MIMEText(body)
134 msg = email.MIMEMultipart.MIMEMultipart()
135 if body: msg.attach(email.MIMEText.MIMEText(body, 'plain'))
136 msg.attach(email.MIMEText.MIMEText('\n'.join(patch), 'x-patch'))
137 else:
138 body += '\n'.join(patch)
139 msg = email.MIMEText.MIMEText(body)
135 if total == 1:
140 if total == 1:
136 subj = '[PATCH] ' + desc[0].strip()
141 subj = '[PATCH] ' + desc[0].strip()
137 else:
142 else:
@@ -274,7 +279,8 b' def patchbomb(ui, repo, *revs, **opts):'
274 cmdtable = {
279 cmdtable = {
275 'email':
280 'email':
276 (patchbomb,
281 (patchbomb,
277 [('', 'bcc', [], 'email addresses of blind copy recipients'),
282 [('a', 'attach', None, 'send patches as inline attachments'),
283 ('', 'bcc', [], 'email addresses of blind copy recipients'),
278 ('c', 'cc', [], 'email addresses of copy recipients'),
284 ('c', 'cc', [], 'email addresses of copy recipients'),
279 ('d', 'diffstat', None, 'add diffstat output to messages'),
285 ('d', 'diffstat', None, 'add diffstat output to messages'),
280 ('f', 'from', '', 'email address of sender'),
286 ('f', 'from', '', 'email address of sender'),
General Comments 0
You need to be logged in to leave comments. Login now