D2568: lfs: convert hexdigest to bytes using sysbytes
This revision was automatically updated to reflect the committed changes. Closed by commit rHGcda13ec1a228: lfs: convert hexdigest to bytes using sysbytes (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2568?vs=6397=6398 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 @@ -10,11 +10,12 @@ import hashlib from mercurial.i18n import _ -from mercurial.node import bin, nullid, short +from mercurial.node import bin, hex, nullid, short 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 = hex(hashlib.sha256(text).digest()) self.opener.lfslocalblobstore.write(oid, text) # replace contents with metadata To: durin42, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2568: lfs: convert hexdigest to bytes using sysbytes
durin42 updated this revision to Diff 6397. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2568?vs=6391=6397 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 @@ -10,11 +10,12 @@ import hashlib from mercurial.i18n import _ -from mercurial.node import bin, nullid, short +from mercurial.node import bin, hex, nullid, short 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 = hex(hashlib.sha256(text).digest()) self.opener.lfslocalblobstore.write(oid, text) # replace contents with metadata To: durin42, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2568: lfs: convert hexdigest to bytes using sysbytes
indygreg requested changes to this revision. indygreg added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > wrapper.py:89 > # git-lfs only supports sha256 > -oid = hashlib.sha256(text).hexdigest() > +oid = pycompat.sysbytes(hashlib.sha256(text).hexdigest()) > self.opener.lfslocalblobstore.write(oid, text) In other places, we've done `mercurial.node.hex(hashlib.sha256(text).digest())` REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2568 To: durin42, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D2568: lfs: convert hexdigest to bytes using sysbytes
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 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel