##// END OF EJS Templates
patchbomb: attachment options changed...
Dennis Schoen -
r5819:89ea99c7 default
parent child Browse files
Show More
@@ -162,9 +162,10 b' def patchbomb(ui, repo, *revs, **opts):'
162 162 if not node:
163 163 raise ValueError
164 164
165 #body = ('\n'.join(desc[1:]).strip() or
166 # 'Patch subject is complete summary.')
167 #body += '\n\n\n'
165 if opts['attach']:
166 body = ('\n'.join(desc[1:]).strip() or
167 'Patch subject is complete summary.')
168 body += '\n\n\n'
168 169
169 170 if opts.get('plain'):
170 171 while patch and patch[0].startswith('# '):
@@ -175,7 +176,7 b' def patchbomb(ui, repo, *revs, **opts):'
175 176 patch.pop(0)
176 177 if opts.get('diffstat'):
177 178 body += cdiffstat('\n'.join(desc), patch) + '\n\n'
178 if opts.get('attach'):
179 if opts.get('attach') or opts.get('inline'):
179 180 msg = email.MIMEMultipart.MIMEMultipart()
180 181 if body:
181 182 msg.attach(email.MIMEText.MIMEText(body, 'plain'))
@@ -191,7 +192,10 b' def patchbomb(ui, repo, *revs, **opts):'
191 192 binnode, idx, total)
192 193 else:
193 194 patchname = cmdutil.make_filename(repo, '%b.patch', binnode)
194 p['Content-Disposition'] = 'inline; filename=' + patchname
195 disposition = 'inline'
196 if opts['attach']:
197 disposition = 'attachment'
198 p['Content-Disposition'] = disposition + '; filename=' + patchname
195 199 msg.attach(p)
196 200 else:
197 201 body += '\n'.join(patch)
@@ -430,7 +434,8 b' def patchbomb(ui, repo, *revs, **opts):'
430 434 cmdtable = {
431 435 "email":
432 436 (patchbomb,
433 [('a', 'attach', None, _('send patches as inline attachments')),
437 [('a', 'attach', None, _('send patches as attachments')),
438 ('i', 'inline', None, _('send patches as inline attachments')),
434 439 ('', 'bcc', [], _('email addresses of blind copy recipients')),
435 440 ('c', 'cc', [], _('email addresses of copy recipients')),
436 441 ('d', 'diffstat', None, _('add diffstat output to messages')),
General Comments 0
You need to be logged in to leave comments. Login now