Show More
@@ -139,6 +139,11 b" configitem('patchbomb', 'to'," | |||||
139 | default=None, |
|
139 | default=None, | |
140 | ) |
|
140 | ) | |
141 |
|
141 | |||
|
142 | if pycompat.ispy3: | |||
|
143 | _bytesgenerator = emailgen.BytesGenerator | |||
|
144 | else: | |||
|
145 | _bytesgenerator = lambda f: f | |||
|
146 | ||||
142 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
147 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | |
143 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
148 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | |
144 | # be specifying the version(s) of Mercurial they are tested with, or |
|
149 | # be specifying the version(s) of Mercurial they are tested with, or | |
@@ -793,7 +798,8 b' def email(ui, repo, *revs, **opts):' | |||||
793 | if opts.get('test'): |
|
798 | if opts.get('test'): | |
794 | ui.status(_('displaying '), subj, ' ...\n') |
|
799 | ui.status(_('displaying '), subj, ' ...\n') | |
795 | ui.pager('email') |
|
800 | ui.pager('email') | |
796 |
generator = emailgen.Generator(ui, |
|
801 | generator = emailgen.Generator(_bytesgenerator(ui), | |
|
802 | mangle_from_=False) | |||
797 | try: |
|
803 | try: | |
798 | generator.flatten(m, 0) |
|
804 | generator.flatten(m, 0) | |
799 | ui.write('\n') |
|
805 | ui.write('\n') | |
@@ -809,7 +815,8 b' def email(ui, repo, *revs, **opts):' | |||||
809 | # Exim does not remove the Bcc field |
|
815 | # Exim does not remove the Bcc field | |
810 | del m['Bcc'] |
|
816 | del m['Bcc'] | |
811 | fp = stringio() |
|
817 | fp = stringio() | |
812 |
generator = emailgen.Generator(fp, |
|
818 | generator = emailgen.Generator(_bytesgenerator(fp), | |
|
819 | mangle_from_=False) | |||
813 | generator.flatten(m, 0) |
|
820 | generator.flatten(m, 0) | |
814 | sendmail(sender_addr, to + bcc + cc, fp.getvalue()) |
|
821 | sendmail(sender_addr, to + bcc + cc, fp.getvalue()) | |
815 |
|
822 |
General Comments 0
You need to be logged in to leave comments.
Login now