Show More
@@ -7,7 +7,6 b'' | |||||
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | import collections |
|
9 | import collections | |
10 | import os |
|
|||
11 |
|
10 | |||
12 | from mercurial.node import bin |
|
11 | from mercurial.node import bin | |
13 | from mercurial.i18n import _ |
|
12 | from mercurial.i18n import _ | |
@@ -22,7 +21,6 b' from mercurial.revlogutils import flagut' | |||||
22 |
|
21 | |||
23 | from . import ( |
|
22 | from . import ( | |
24 | constants, |
|
23 | constants, | |
25 | fileserverclient, |
|
|||
26 | shallowutil, |
|
24 | shallowutil, | |
27 | ) |
|
25 | ) | |
28 |
|
26 | |||
@@ -387,33 +385,6 b' class remotefilelog:' | |||||
387 | def rawdata(self, node): |
|
385 | def rawdata(self, node): | |
388 | return self.revision(node, raw=False) |
|
386 | return self.revision(node, raw=False) | |
389 |
|
387 | |||
390 | def _read(self, id): |
|
|||
391 | """reads the raw file blob from disk, cache, or server""" |
|
|||
392 | fileservice = self.repo.fileservice |
|
|||
393 | localcache = fileservice.localcache |
|
|||
394 | cachekey = fileserverclient.getcachekey( |
|
|||
395 | self.repo.name, self.filename, id |
|
|||
396 | ) |
|
|||
397 | try: |
|
|||
398 | return localcache.read(cachekey) |
|
|||
399 | except KeyError: |
|
|||
400 | pass |
|
|||
401 |
|
||||
402 | localkey = fileserverclient.getlocalkey(self.filename, id) |
|
|||
403 | localpath = os.path.join(self.localpath, localkey) |
|
|||
404 | try: |
|
|||
405 | return shallowutil.readfile(localpath) |
|
|||
406 | except IOError: |
|
|||
407 | pass |
|
|||
408 |
|
||||
409 | fileservice.prefetch([(self.filename, id)]) |
|
|||
410 | try: |
|
|||
411 | return localcache.read(cachekey) |
|
|||
412 | except KeyError: |
|
|||
413 | pass |
|
|||
414 |
|
||||
415 | raise error.LookupError(id, self.filename, _(b'no node')) |
|
|||
416 |
|
||||
417 | def ancestormap(self, node): |
|
388 | def ancestormap(self, node): | |
418 | return self.repo.metadatastore.getancestors(self.filename, node) |
|
389 | return self.repo.metadatastore.getancestors(self.filename, node) | |
419 |
|
390 |
General Comments 0
You need to be logged in to leave comments.
Login now