Mercurial > hg
comparison hgext/hooklib/changeset_published.py @ 49865:5392bf258049
hooklib: force an exception wrapped by errors.Abort to bytestr
Flagged by PyCharm and pytype.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 06 Jan 2023 00:05:14 -0500 |
parents | ef5f5f1cbd90 |
children |
comparison
equal
deleted
inserted
replaced
49864:5f006f789373 | 49865:5392bf258049 |
---|---|
29 logcmdutil, | 29 logcmdutil, |
30 mail, | 30 mail, |
31 pycompat, | 31 pycompat, |
32 registrar, | 32 registrar, |
33 ) | 33 ) |
34 from mercurial.utils import dateutil | 34 from mercurial.utils import ( |
35 dateutil, | |
36 stringutil, | |
37 ) | |
35 from .. import notify | 38 from .. import notify |
36 | 39 |
37 configtable = {} | 40 configtable = {} |
38 configitem = registrar.configitem(configtable) | 41 configitem = registrar.configitem(configtable) |
39 | 42 |
95 data = ui.popbuffer() | 98 data = ui.popbuffer() |
96 | 99 |
97 try: | 100 try: |
98 msg = mail.parsebytes(data) | 101 msg = mail.parsebytes(data) |
99 except emailerrors.MessageParseError as inst: | 102 except emailerrors.MessageParseError as inst: |
100 raise error.Abort(inst) | 103 raise error.Abort(stringutil.forcebytestr(inst)) |
101 | 104 |
102 msg['In-reply-to'] = notify.messageid(ctx, domain, messageidseed) | 105 msg['In-reply-to'] = notify.messageid(ctx, domain, messageidseed) |
103 msg['Message-Id'] = notify.messageid( | 106 msg['Message-Id'] = notify.messageid( |
104 ctx, domain, messageidseed + b'-published' | 107 ctx, domain, messageidseed + b'-published' |
105 ) | 108 ) |