##// END OF EJS Templates
py3: use node.hex(h.digest()) instead of h.hexdigest()...
Pulkit Goyal -
r40648:3fa4183e default
parent child Browse files
Show More
@@ -15,6 +15,7 b' from mercurial.i18n import _'
15 15 from mercurial import (
16 16 error,
17 17 filelog,
18 node as nodemod,
18 19 revlog,
19 20 )
20 21 from . import (
@@ -52,7 +53,7 b' def debugremotefilelog(ui, path, **opts)'
52 53
53 54 def buildtemprevlog(repo, file):
54 55 # get filename key
55 filekey = hashlib.sha1(file).hexdigest()
56 filekey = nodemod.hex(hashlib.sha1(file).digest())
56 57 filedir = os.path.join(repo.path, 'store/data', filekey)
57 58
58 59 # sort all entries based on linkrev
@@ -344,7 +345,7 b' def dumpdeltachain(ui, deltachain, **opt'
344 345 ui.write("%s %s %s %s\n" % (
345 346 hashformatter(node),
346 347 hashformatter(deltabasenode),
347 hashlib.sha1(delta).hexdigest(),
348 nodemod.hex(hashlib.sha1(delta).digest()),
348 349 len(delta)))
349 350
350 351 def debughistorypack(ui, path):
@@ -18,6 +18,7 b' from mercurial.i18n import _'
18 18 from mercurial.node import bin, hex, nullid
19 19 from mercurial import (
20 20 error,
21 node,
21 22 pycompat,
22 23 revlog,
23 24 sshpeer,
@@ -44,11 +45,11 b' fetchmisses = 0'
44 45 _downloading = _('downloading')
45 46
46 47 def getcachekey(reponame, file, id):
47 pathhash = hashlib.sha1(file).hexdigest()
48 pathhash = node.hex(hashlib.sha1(file).digest())
48 49 return os.path.join(reponame, pathhash[:2], pathhash[2:], id)
49 50
50 51 def getlocalkey(file, id):
51 pathhash = hashlib.sha1(file).hexdigest()
52 pathhash = node.hex(hashlib.sha1(file).digest())
52 53 return os.path.join(pathhash, id)
53 54
54 55 def peersetup(ui, peer):
@@ -17,6 +17,7 b' import tempfile'
17 17 from mercurial.i18n import _
18 18 from mercurial import (
19 19 error,
20 node,
20 21 pycompat,
21 22 revlog,
22 23 util,
@@ -35,11 +36,11 b' def isenabled(repo):'
35 36 return constants.SHALLOWREPO_REQUIREMENT in repo.requirements
36 37
37 38 def getcachekey(reponame, file, id):
38 pathhash = hashlib.sha1(file).hexdigest()
39 pathhash = node.hex(hashlib.sha1(file).digest())
39 40 return os.path.join(reponame, pathhash[:2], pathhash[2:], id)
40 41
41 42 def getlocalkey(file, id):
42 pathhash = hashlib.sha1(file).hexdigest()
43 pathhash = node.hex(hashlib.sha1(file).digest())
43 44 return os.path.join(pathhash, id)
44 45
45 46 def getcachepath(ui, allowempty=False):
General Comments 0
You need to be logged in to leave comments. Login now