Mercurial > public > mercurial-scm > hg-stable
comparison hgext/hooklib/changeset_obsoleted.py @ 49947: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 | f4733654f144 |
comparison
equal
deleted
inserted
replaced
49946:5f006f789373 | 49947:5392bf258049 |
---|---|
30 mail, | 30 mail, |
31 obsutil, | 31 obsutil, |
32 pycompat, | 32 pycompat, |
33 registrar, | 33 registrar, |
34 ) | 34 ) |
35 from mercurial.utils import dateutil | 35 from mercurial.utils import ( |
36 dateutil, | |
37 stringutil, | |
38 ) | |
36 from .. import notify | 39 from .. import notify |
37 | 40 |
38 configtable = {} | 41 configtable = {} |
39 configitem = registrar.configitem(configtable) | 42 configitem = registrar.configitem(configtable) |
40 | 43 |
96 data = ui.popbuffer() | 99 data = ui.popbuffer() |
97 | 100 |
98 try: | 101 try: |
99 msg = mail.parsebytes(data) | 102 msg = mail.parsebytes(data) |
100 except emailerrors.MessageParseError as inst: | 103 except emailerrors.MessageParseError as inst: |
101 raise error.Abort(inst) | 104 raise error.Abort(stringutil.forcebytestr(inst)) |
102 | 105 |
103 msg['In-reply-to'] = notify.messageid(ctx, domain, messageidseed) | 106 msg['In-reply-to'] = notify.messageid(ctx, domain, messageidseed) |
104 msg['Message-Id'] = notify.messageid( | 107 msg['Message-Id'] = notify.messageid( |
105 ctx, domain, messageidseed + b'-obsoleted' | 108 ctx, domain, messageidseed + b'-obsoleted' |
106 ) | 109 ) |