D2568: lfs: convert hexdigest to bytes using sysbytes

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri Mar 2 22:15:26 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/lfs/wrapper.py

CHANGE DETAILS

diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py
--- a/hgext/lfs/wrapper.py
+++ b/hgext/lfs/wrapper.py
@@ -15,6 +15,7 @@
 from mercurial import (
     error,
     filelog,
+    pycompat,
     revlog,
     util,
 )
@@ -85,7 +86,7 @@
         text = text[offset:]
 
     # git-lfs only supports sha256
-    oid = hashlib.sha256(text).hexdigest()
+    oid = pycompat.sysbytes(hashlib.sha256(text).hexdigest())
     self.opener.lfslocalblobstore.write(oid, text)
 
     # replace contents with metadata



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list