mercurial/bundlerepo.py
changeset 35050 a2dfc723b6b5
parent 34300 0fe62d8bdd50
child 35070 32d079f37207
--- a/mercurial/bundlerepo.py	Thu Oct 19 12:35:47 2017 +0200
+++ b/mercurial/bundlerepo.py	Tue Nov 07 10:16:53 2017 -0800
@@ -352,6 +352,15 @@
         self.filestart = self.bundle.tell()
         return m
 
+    def _consumemanifest(self):
+        """Consumes the manifest portion of the bundle, setting filestart so the
+        file portion can be read."""
+        self.bundle.seek(self.manstart)
+        self.bundle.manifestheader()
+        for delta in self.bundle.deltaiter():
+            pass
+        self.filestart = self.bundle.tell()
+
     @localrepo.unfilteredpropertycache
     def manstart(self):
         self.changelog
@@ -360,6 +369,14 @@
     @localrepo.unfilteredpropertycache
     def filestart(self):
         self.manifestlog
+
+        # If filestart was not set by self.manifestlog, that means the
+        # manifestlog implementation did not consume the manifests from the
+        # changegroup (ex: it might be consuming trees from a separate bundle2
+        # part instead). So we need to manually consume it.
+        if 'filestart' not in self.__dict__:
+            self._consumemanifest()
+
         return self.filestart
 
     def url(self):