bundle: fix up lazy reads
authorBrendan Cully <brendan@kublai.com>
Mon, 27 Aug 2007 17:08:53 -0700
changeset 5263 8040f2e4cad0
parent 5262 a35756389ef4
child 5264 0fc16031bb45
bundle: fix up lazy reads
mercurial/bundlerepo.py
--- a/mercurial/bundlerepo.py	Mon Aug 27 15:48:21 2007 -0700
+++ b/mercurial/bundlerepo.py	Mon Aug 27 17:08:53 2007 -0700
@@ -199,12 +199,20 @@
     def __getattr__(self, name):
         if name == 'changelog':
             self.changelog = bundlechangelog(self.sopener, self.bundlefile)
+            self.manstart = self.bundlefile.tell()
             return self.changelog
         if name == 'manifest':
+            self.bundlefile.seek(self.manstart)
             self.manifest = bundlemanifest(self.sopener, self.bundlefile,
                                            self.changelog.rev)
             self.filestart = self.bundlefile.tell()
             return self.manifest
+        if name == 'manstart':
+            self.changelog
+            return self.manstart
+        if name == 'filestart':
+            self.manifest
+            return self.filestart
         return localrepo.localrepository.__getattr__(self, name)
 
     def url(self):
@@ -215,7 +223,6 @@
 
     def file(self, f):
         if not self.bundlefilespos:
-            self.manifest
             self.bundlefile.seek(self.filestart)
             while 1:
                 chunk = changegroup.getchunk(self.bundlefile)