equal
deleted
inserted
replaced
15 |
15 |
16 from mercurial.i18n import _ |
16 from mercurial.i18n import _ |
17 from mercurial.node import bin, hex, nullid |
17 from mercurial.node import bin, hex, nullid |
18 from mercurial import ( |
18 from mercurial import ( |
19 error, |
19 error, |
20 node, |
|
21 pycompat, |
20 pycompat, |
22 revlog, |
21 revlog, |
23 sshpeer, |
22 sshpeer, |
24 util, |
23 util, |
25 wireprotov1peer, |
24 wireprotov1peer, |
45 |
44 |
46 _lfsmod = None |
45 _lfsmod = None |
47 |
46 |
48 |
47 |
49 def getcachekey(reponame, file, id): |
48 def getcachekey(reponame, file, id): |
50 pathhash = node.hex(hashutil.sha1(file).digest()) |
49 pathhash = hex(hashutil.sha1(file).digest()) |
51 return os.path.join(reponame, pathhash[:2], pathhash[2:], id) |
50 return os.path.join(reponame, pathhash[:2], pathhash[2:], id) |
52 |
51 |
53 |
52 |
54 def getlocalkey(file, id): |
53 def getlocalkey(file, id): |
55 pathhash = node.hex(hashutil.sha1(file).digest()) |
54 pathhash = hex(hashutil.sha1(file).digest()) |
56 return os.path.join(pathhash, id) |
55 return os.path.join(pathhash, id) |
57 |
56 |
58 |
57 |
59 def peersetup(ui, peer): |
58 def peersetup(ui, peer): |
60 class remotefilepeer(peer.__class__): |
59 class remotefilepeer(peer.__class__): |