Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG751caa6a2936: patchbomb: use sysstrs when describing content-type
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 (2 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| Augie Fackler | Aug 9 2018, 7:37 PM |
| _charsets = mail._charsets(ui) | _charsets = mail._charsets(ui) | ||||
| subj = (opts.get(r'subject') | subj = (opts.get(r'subject') | ||||
| or prompt(ui, 'Subject:', 'A bundle for your repository')) | or prompt(ui, 'Subject:', 'A bundle for your repository')) | ||||
| 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(r'application', r'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(r'Content-Disposition', r'attachment', | datapart.add_header(r'Content-Disposition', r'attachment', | ||||
| filename=encoding.strfromlocal(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)] | ||||