Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGed9537bd2d1a: patchbomb: use native strs for email header keys and values
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/patchbomb.py (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Augie Fackler | Aug 9 2018, 6:28 PM |
body = _getdescription(repo, '', sender, **opts) | body = _getdescription(repo, '', sender, **opts) | ||||
msg = emimemultipart.MIMEMultipart() | msg = emimemultipart.MIMEMultipart() | ||||
if body: | if body: | ||||
msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) | ||||
datapart = emimebase.MIMEBase('application', 'x-mercurial-bundle') | datapart = emimebase.MIMEBase('application', 'x-mercurial-bundle') | ||||
datapart.set_payload(bundle) | datapart.set_payload(bundle) | ||||
bundlename = '%s.hg' % opts.get(r'bundlename', 'bundle') | bundlename = '%s.hg' % opts.get(r'bundlename', 'bundle') | ||||
datapart.add_header('Content-Disposition', 'attachment', | datapart.add_header(r'Content-Disposition', r'attachment', | ||||
filename=bundlename) | filename=encoding.strfromlocal(bundlename)) | ||||
emailencoders.encode_base64(datapart) | emailencoders.encode_base64(datapart) | ||||
msg.attach(datapart) | msg.attach(datapart) | ||||
msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get(r'test')) | msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get(r'test')) | ||||
return [(msg, subj, None)] | return [(msg, subj, None)] | ||||
def _makeintro(repo, sender, revs, patches, **opts): | def _makeintro(repo, sender, revs, patches, **opts): | ||||
"""make an introduction email, asking the user for content if needed | """make an introduction email, asking the user for content if needed | ||||