def file(self, f): if not self.bundlefilespos: self.bundlefile.seek(self.filestart) while 1: chunk = changegroup.getchunk(self.bundlefile) if not chunk: break self.bundlefilespos[chunk] = self.bundlefile.tell() for c in changegroup.chunkiter(self.bundlefile): pass if f[0] == '/': f = f[1:] if f in self.bundlefilespos: self.bundlefile.seek(self.bundlefilespos[f]) return bundlefilelog(self.sopener, f, self.bundlefile, self.changelog.rev) else: return filelog.filelog(self.sopener, f)
def chunkpositer(): for chunk in changegroup.chunkiter(bundlefile): pos = bundlefile.tell() yield chunk, pos - len(chunk)