Mercurial > public > mercurial-scm > hg-stable
comparison hgext/hooklib/changeset_published.py @ 49296:ef5f5f1cbd90
py3: constant-fold some `pycompat.ispy3`
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 31 May 2022 00:50:29 +0200 |
parents | 6000f5b25c9b |
children | 5392bf258049 |
comparison
equal
deleted
inserted
replaced
49295:7fe82a5101c9 | 49296:ef5f5f1cbd90 |
---|---|
111 if b'@' not in sender or b'@localhost' in sender: | 111 if b'@' not in sender or b'@localhost' in sender: |
112 sender = n.fixmail(sender) | 112 sender = n.fixmail(sender) |
113 msg['From'] = mail.addressencode(ui, sender, n.charsets, n.test) | 113 msg['From'] = mail.addressencode(ui, sender, n.charsets, n.test) |
114 msg['To'] = ', '.join(sorted(subs)) | 114 msg['To'] = ', '.join(sorted(subs)) |
115 | 115 |
116 msgtext = msg.as_bytes() if pycompat.ispy3 else msg.as_string() | 116 msgtext = msg.as_bytes() |
117 if ui.configbool(b'notify', b'test'): | 117 if ui.configbool(b'notify', b'test'): |
118 ui.write(msgtext) | 118 ui.write(msgtext) |
119 if not msgtext.endswith(b'\n'): | 119 if not msgtext.endswith(b'\n'): |
120 ui.write(b'\n') | 120 ui.write(b'\n') |
121 else: | 121 else: |