diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -805,7 +805,11 @@ while headerblock is not None: part = unbundlepart(self.ui, headerblock, self._fp) yield part + # Seek to the end of the part to force it's consumption so the next + # part can be read. But then seek back to the beginning so the + # code consuming this generator has a part that starts at 0. part.seek(0, 2) + part.seek(0) headerblock = self._readpartheader() indebug(self.ui, 'end of bundle2 stream') diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -301,7 +301,6 @@ if cgstream is None: raise error.Abort(_('No changegroups found')) - cgstream.seek(0) self.bundle = changegroup.getunbundler(version, cgstream, 'UN')