Mercurial > hg > mercurial-source
changeset 43951:c32531444cdc
notify: cast hash to bytes
This is needed to avoid a str/bytes mismatch when interpolating a
line or 2 later.
Differential Revision: https://phab.mercurial-scm.org/D7021
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 07 Oct 2019 21:21:16 -0400 (2019-10-08) |
parents | 5617b748aad8 |
children | 227ba1afcb65 |
files | hgext/notify.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/notify.py +++ b/hgext/notify.py @@ -161,6 +161,7 @@ logcmdutil, mail, patch, + pycompat, registrar, util, ) @@ -559,7 +560,10 @@ host = encoding.strtolocal(socket.getfqdn()) if messageidseed: messagehash = hashlib.sha512(ctx.hex() + messageidseed) - messageid = b'<hg.%s@%s>' % (messagehash.hexdigest()[:64], host) + messageid = b'<hg.%s@%s>' % ( + pycompat.sysbytes(messagehash.hexdigest()[:64]), + host, + ) else: messageid = b'<hg.%s.%d.%d@%s>' % ( ctx,