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