Show More
@@ -75,6 +75,7 b' from __future__ import absolute_import' | |||||
75 |
|
75 | |||
76 | import email as emailmod |
|
76 | import email as emailmod | |
77 | import email.generator as emailgen |
|
77 | import email.generator as emailgen | |
|
78 | import email.mime.multipart as emimemultipart | |||
78 | import email.utils as eutil |
|
79 | import email.utils as eutil | |
79 | import errno |
|
80 | import errno | |
80 | import os |
|
81 | import os | |
@@ -254,7 +255,7 b' def makepatch(ui, repo, rev, patchlines,' | |||||
254 | body += '\n'.join(patchlines) |
|
255 | body += '\n'.join(patchlines) | |
255 |
|
256 | |||
256 | if addattachment: |
|
257 | if addattachment: | |
257 |
msg = em |
|
258 | msg = emimemultipart.MIMEMultipart() | |
258 | if body: |
|
259 | if body: | |
259 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) |
|
260 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) | |
260 | p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', |
|
261 | p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', | |
@@ -365,7 +366,7 b' def _getbundlemsgs(repo, sender, bundle,' | |||||
365 | or prompt(ui, 'Subject:', 'A bundle for your repository')) |
|
366 | or prompt(ui, 'Subject:', 'A bundle for your repository')) | |
366 |
|
367 | |||
367 | body = _getdescription(repo, '', sender, **opts) |
|
368 | body = _getdescription(repo, '', sender, **opts) | |
368 |
msg = em |
|
369 | msg = emimemultipart.MIMEMultipart() | |
369 | if body: |
|
370 | if body: | |
370 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) |
|
371 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) | |
371 | datapart = emailmod.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') |
|
372 | datapart = emailmod.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') |
General Comments 0
You need to be logged in to leave comments.
Login now