Patchwork D7021: notify: cast hash to bytes

login
register
mail settings
Submitter phabricator
Date Oct. 10, 2019, 2:11 p.m.
Message ID <0d26cac6ea13285fb9cd3d89131a44e0@localhost.localdomain>
Download mbox | patch
Permalink /patch/42187/
State Not Applicable
Headers show

Comments

phabricator - Oct. 10, 2019, 2:11 p.m.
Closed by commit rHGc32531444cdc: notify: cast hash to bytes (authored by indygreg).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7021?vs=16958&id=17045

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7021/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7021

AFFECTED FILES
  hgext/notify.py

CHANGE DETAILS




To: indygreg, #hg-reviewers, marmoute, pulkit
Cc: marmoute, mercurial-devel

Patch

diff --git a/hgext/notify.py b/hgext/notify.py
--- 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,