equal
deleted
inserted
replaced
10 import hashlib |
10 import hashlib |
11 import io |
11 import io |
12 import os |
12 import os |
13 import threading |
13 import threading |
14 import time |
14 import time |
|
15 import zlib |
15 |
16 |
16 from mercurial.i18n import _ |
17 from mercurial.i18n import _ |
17 from mercurial.node import bin, hex, nullid |
18 from mercurial.node import bin, hex, nullid |
18 from mercurial import ( |
19 from mercurial import ( |
19 error, |
20 error, |
25 from mercurial.utils import procutil |
26 from mercurial.utils import procutil |
26 |
27 |
27 from . import ( |
28 from . import ( |
28 constants, |
29 constants, |
29 contentstore, |
30 contentstore, |
30 lz4wrapper, |
|
31 metadatastore, |
31 metadatastore, |
32 ) |
32 ) |
33 |
33 |
34 _sshv1peer = sshpeer.sshv1peer |
34 _sshv1peer = sshpeer.sshv1peer |
35 |
35 |
442 raise error.ResponseError(_("error downloading file contents:"), |
442 raise error.ResponseError(_("error downloading file contents:"), |
443 _("only received %s of %s bytes") |
443 _("only received %s of %s bytes") |
444 % (len(data), size)) |
444 % (len(data), size)) |
445 |
445 |
446 self.writedata.addremotefilelognode(filename, bin(node), |
446 self.writedata.addremotefilelognode(filename, bin(node), |
447 lz4wrapper.lz4decompress(data)) |
447 zlib.decompress(data)) |
448 |
448 |
449 def connect(self): |
449 def connect(self): |
450 if self.cacheprocess: |
450 if self.cacheprocess: |
451 cmd = "%s %s" % (self.cacheprocess, self.writedata._path) |
451 cmd = "%s %s" % (self.cacheprocess, self.writedata._path) |
452 self.remotecache.connect(cmd) |
452 self.remotecache.connect(cmd) |