##// END OF EJS Templates
bundlerepo: rename "bundlefilespos" variable and attribute...
Gregory Szorc -
r35076:cd4cd7b9 default
parent child Browse files
Show More
@@ -247,14 +247,14 b' class bundlephasecache(phases.phasecache'
247 self.invalidate()
247 self.invalidate()
248 self.dirty = True
248 self.dirty = True
249
249
250 bundlefilespos = {}
251 def _getfilestarts(cgunpacker):
250 def _getfilestarts(cgunpacker):
251 filespos = {}
252 for chunkdata in iter(cgunpacker.filelogheader, {}):
252 for chunkdata in iter(cgunpacker.filelogheader, {}):
253 fname = chunkdata['filename']
253 fname = chunkdata['filename']
254 bundlefilespos[fname] = bundle.tell()
254 filespos[fname] = cgunpacker.tell()
255 for chunk in iter(lambda: cgunpacker.deltachunk(None), {}):
255 for chunk in iter(lambda: cgunpacker.deltachunk(None), {}):
256 pass
256 pass
257 return bundlefilespos
257 return filespos
258
258
259 class bundlerepository(localrepo.localrepository):
259 class bundlerepository(localrepo.localrepository):
260 """A repository instance that is a union of a local repo and a bundle.
260 """A repository instance that is a union of a local repo and a bundle.
@@ -312,8 +312,8 b' class bundlerepository(localrepo.localre'
312 raise error.Abort(_('bundle type %s cannot be read') %
312 raise error.Abort(_('bundle type %s cannot be read') %
313 type(bundle))
313 type(bundle))
314
314
315 # dict with the mapping 'filename' -> position in the bundle
315 # dict with the mapping 'filename' -> position in the changegroup.
316 self.bundlefilespos = {}
316 self._cgfilespos = {}
317
317
318 self.firstnewrev = self.changelog.repotiprev + 1
318 self.firstnewrev = self.changelog.repotiprev + 1
319 phases.retractboundary(self, None, phases.draft,
319 phases.retractboundary(self, None, phases.draft,
@@ -403,12 +403,12 b' class bundlerepository(localrepo.localre'
403 return self._url
403 return self._url
404
404
405 def file(self, f):
405 def file(self, f):
406 if not self.bundlefilespos:
406 if not self._cgfilespos:
407 self._cgunpacker.seek(self.filestart)
407 self._cgunpacker.seek(self.filestart)
408 self.bundlefilespos = _getfilestarts(self._cgunpacker)
408 self._cgfilespos = _getfilestarts(self._cgunpacker)
409
409
410 if f in self.bundlefilespos:
410 if f in self._cgfilespos:
411 self._cgunpacker.seek(self.bundlefilespos[f])
411 self._cgunpacker.seek(self._cgfilespos[f])
412 linkmapper = self.unfiltered().changelog.rev
412 linkmapper = self.unfiltered().changelog.rev
413 return bundlefilelog(self.svfs, f, self._cgunpacker, linkmapper)
413 return bundlefilelog(self.svfs, f, self._cgunpacker, linkmapper)
414 else:
414 else:
General Comments 0
You need to be logged in to leave comments. Login now