Mercurial > public > mercurial-scm > hg
diff hgext/remotefilelog/debugcommands.py @ 40612:3fa4183e7803
py3: use node.hex(h.digest()) instead of h.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D5261
author | Pulkit Goyal <pulkit@yandex-team.ru> |
---|---|
date | Tue, 13 Nov 2018 18:07:21 +0300 |
parents | 13d4ad8d7801 |
children | aa588bf40a08 |
line wrap: on
line diff
--- a/hgext/remotefilelog/debugcommands.py Tue Nov 13 17:41:54 2018 +0300 +++ b/hgext/remotefilelog/debugcommands.py Tue Nov 13 18:07:21 2018 +0300 @@ -15,6 +15,7 @@ from mercurial import ( error, filelog, + node as nodemod, revlog, ) from . import ( @@ -52,7 +53,7 @@ def buildtemprevlog(repo, file): # get filename key - filekey = hashlib.sha1(file).hexdigest() + filekey = nodemod.hex(hashlib.sha1(file).digest()) filedir = os.path.join(repo.path, 'store/data', filekey) # sort all entries based on linkrev @@ -344,7 +345,7 @@ ui.write("%s %s %s %s\n" % ( hashformatter(node), hashformatter(deltabasenode), - hashlib.sha1(delta).hexdigest(), + nodemod.hex(hashlib.sha1(delta).digest()), len(delta))) def debughistorypack(ui, path):