bundlerepo: uncompress changegroup in bundle1 case only
Uncompressing bundle2 needs to be handled differently.
--- a/mercurial/bundlerepo.py Mon Oct 19 17:58:04 2015 +0200
+++ b/mercurial/bundlerepo.py Mon Oct 19 18:04:08 2015 +0200
@@ -275,11 +275,6 @@
self.tempfile = None
f = util.posixfile(bundlename, "rb")
self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename)
- if self.bundle.compressed():
- f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN')
- self.bundlefile = self.bundle = exchange.readbundle(ui, f,
- bundlename,
- self.vfs)
if isinstance(self.bundle, bundle2.unbundle20):
cgparts = [part for part in self.bundle.iterparts()
@@ -299,6 +294,12 @@
part.seek(0)
self.bundle = changegroup.packermap[version][1](part, 'UN')
+ elif self.bundle.compressed():
+ f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN')
+ self.bundlefile = self.bundle = exchange.readbundle(ui, f,
+ bundlename,
+ self.vfs)
+
# dict with the mapping 'filename' -> position in the bundle
self.bundlefilespos = {}