Show More
@@ -58,7 +58,7 b' You can set patchbomb to always ask for ' | |||
|
58 | 58 | ''' |
|
59 | 59 | |
|
60 | 60 | import os, errno, socket, tempfile, cStringIO |
|
61 | import email | |
|
61 | import email as emailmod | |
|
62 | 62 | |
|
63 | 63 | from mercurial import cmdutil, commands, hg, mail, patch, util, error |
|
64 | 64 | from mercurial import scmutil |
@@ -155,7 +155,7 b' def makepatch(ui, repo, patchlines, opts' | |||
|
155 | 155 | body += '\n'.join(patchlines) |
|
156 | 156 | |
|
157 | 157 | if addattachment: |
|
158 | msg = email.MIMEMultipart.MIMEMultipart() | |
|
158 | msg = emailmod.MIMEMultipart.MIMEMultipart() | |
|
159 | 159 | if body: |
|
160 | 160 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) |
|
161 | 161 | p = mail.mimetextpatch('\n'.join(patchlines), 'x-patch', |
@@ -272,15 +272,15 b' def _getbundlemsgs(repo, sender, bundle,' | |||
|
272 | 272 | or prompt(ui, 'Subject:', 'A bundle for your repository')) |
|
273 | 273 | |
|
274 | 274 | body = _getdescription(repo, '', sender, **opts) |
|
275 | msg = email.MIMEMultipart.MIMEMultipart() | |
|
275 | msg = emailmod.MIMEMultipart.MIMEMultipart() | |
|
276 | 276 | if body: |
|
277 | 277 | msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) |
|
278 | datapart = email.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') | |
|
278 | datapart = emailmod.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') | |
|
279 | 279 | datapart.set_payload(bundle) |
|
280 | 280 | bundlename = '%s.hg' % opts.get('bundlename', 'bundle') |
|
281 | 281 | datapart.add_header('Content-Disposition', 'attachment', |
|
282 | 282 | filename=bundlename) |
|
283 | email.Encoders.encode_base64(datapart) | |
|
283 | emailmod.Encoders.encode_base64(datapart) | |
|
284 | 284 | msg.attach(datapart) |
|
285 | 285 | msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) |
|
286 | 286 | return [(msg, subj, None)] |
@@ -403,7 +403,7 b' emailopts = [' | |||
|
403 | 403 | ('', 'intro', None, _('send an introduction email for a single patch')), |
|
404 | 404 | ] + emailopts + commands.remoteopts, |
|
405 | 405 | _('hg email [OPTION]... [DEST]...')) |
|
406 |
def |
|
|
406 | def email(ui, repo, *revs, **opts): | |
|
407 | 407 | '''send changesets by email |
|
408 | 408 | |
|
409 | 409 | By default, diffs are sent in the format generated by |
@@ -641,7 +641,7 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
641 | 641 | if not parent.endswith('>'): |
|
642 | 642 | parent += '>' |
|
643 | 643 | |
|
644 | sender_addr = email.Utils.parseaddr(sender)[1] | |
|
644 | sender_addr = emailmod.Utils.parseaddr(sender)[1] | |
|
645 | 645 | sender = mail.addressencode(ui, sender, _charsets, opts.get('test')) |
|
646 | 646 | sendmail = None |
|
647 | 647 | firstpatch = None |
@@ -660,7 +660,7 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
660 | 660 | parent = m['Message-Id'] |
|
661 | 661 | |
|
662 | 662 | m['User-Agent'] = 'Mercurial-patchbomb/%s' % util.version() |
|
663 | m['Date'] = email.Utils.formatdate(start_time[0], localtime=True) | |
|
663 | m['Date'] = emailmod.Utils.formatdate(start_time[0], localtime=True) | |
|
664 | 664 | |
|
665 | 665 | start_time = (start_time[0] + 1, start_time[1]) |
|
666 | 666 | m['From'] = sender |
@@ -678,7 +678,7 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
678 | 678 | fp = util.popen(os.environ['PAGER'], 'w') |
|
679 | 679 | else: |
|
680 | 680 | fp = ui |
|
681 | generator = email.Generator.Generator(fp, mangle_from_=False) | |
|
681 | generator = emailmod.Generator.Generator(fp, mangle_from_=False) | |
|
682 | 682 | try: |
|
683 | 683 | generator.flatten(m, 0) |
|
684 | 684 | fp.write('\n') |
@@ -702,7 +702,7 b' def patchbomb(ui, repo, *revs, **opts):' | |||
|
702 | 702 | # Exim does not remove the Bcc field |
|
703 | 703 | del m['Bcc'] |
|
704 | 704 | fp = cStringIO.StringIO() |
|
705 | generator = email.Generator.Generator(fp, mangle_from_=False) | |
|
705 | generator = emailmod.Generator.Generator(fp, mangle_from_=False) | |
|
706 | 706 | generator.flatten(m, 0) |
|
707 | 707 | sendmail(sender_addr, to + bcc + cc, fp.getvalue()) |
|
708 | 708 |
General Comments 0
You need to be logged in to leave comments.
Login now