equal
deleted
inserted
replaced
463 |
463 |
464 if not msg.is_multipart(): |
464 if not msg.is_multipart(): |
465 # create fresh mime message from scratch |
465 # create fresh mime message from scratch |
466 # (multipart templates must take care of this themselves) |
466 # (multipart templates must take care of this themselves) |
467 headers = msg.items() |
467 headers = msg.items() |
468 payload = msg.get_payload(decode=pycompat.ispy3) |
468 payload = msg.get_payload(decode=True) |
469 # for notification prefer readability over data precision |
469 # for notification prefer readability over data precision |
470 msg = mail.mimeencode(self.ui, payload, self.charsets, self.test) |
470 msg = mail.mimeencode(self.ui, payload, self.charsets, self.test) |
471 # reinstate custom headers |
471 # reinstate custom headers |
472 for k, v in headers: |
472 for k, v in headers: |
473 msg[k] = v |
473 msg[k] = v |
522 msg['In-Reply-To'] = messageid( |
522 msg['In-Reply-To'] = messageid( |
523 pred, self.domain, self.messageidseed |
523 pred, self.domain, self.messageidseed |
524 ) |
524 ) |
525 msg['To'] = ', '.join(sorted(subs)) |
525 msg['To'] = ', '.join(sorted(subs)) |
526 |
526 |
527 msgtext = msg.as_bytes() if pycompat.ispy3 else msg.as_string() |
527 msgtext = msg.as_bytes() |
528 if self.test: |
528 if self.test: |
529 self.ui.write(msgtext) |
529 self.ui.write(msgtext) |
530 if not msgtext.endswith(b'\n'): |
530 if not msgtext.endswith(b'\n'): |
531 self.ui.write(b'\n') |
531 self.ui.write(b'\n') |
532 else: |
532 else: |