##// END OF EJS Templates
bundlerepo: introduce method to find file starts and use it...
Augie Fackler -
r29712:9e88077f default
parent child Browse files
Show More
@@ -234,6 +234,15 b' class bundlephasecache(phases.phasecache'
234 self.invalidate()
234 self.invalidate()
235 self.dirty = True
235 self.dirty = True
236
236
237 def _getfilestarts(bundle):
238 bundlefilespos = {}
239 for chunkdata in iter(bundle.filelogheader, {}):
240 fname = chunkdata['filename']
241 bundlefilespos[fname] = bundle.tell()
242 for chunk in iter(lambda: bundle.deltachunk(None), {}):
243 pass
244 return bundlefilespos
245
237 class bundlerepository(localrepo.localrepository):
246 class bundlerepository(localrepo.localrepository):
238 def __init__(self, ui, path, bundlename):
247 def __init__(self, ui, path, bundlename):
239 def _writetempbundle(read, suffix, header=''):
248 def _writetempbundle(read, suffix, header=''):
@@ -349,13 +358,7 b' class bundlerepository(localrepo.localre'
349 def file(self, f):
358 def file(self, f):
350 if not self.bundlefilespos:
359 if not self.bundlefilespos:
351 self.bundle.seek(self.filestart)
360 self.bundle.seek(self.filestart)
352 for chunkdata in iter(self.bundle.filelogheader, {}):
361 self.bundlefilespos = _getfilestarts(self.bundle)
353 fname = chunkdata['filename']
354 self.bundlefilespos[fname] = self.bundle.tell()
355 while True:
356 c = self.bundle.deltachunk(None)
357 if not c:
358 break
359
362
360 if f in self.bundlefilespos:
363 if f in self.bundlefilespos:
361 self.bundle.seek(self.bundlefilespos[f])
364 self.bundle.seek(self.bundlefilespos[f])
General Comments 0
You need to be logged in to leave comments. Login now