bundlerepo: uncompress changegroup in bundle1 case only
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 19 Oct 2015 18:04:08 +0200
changeset 26801 73bf76bf6f14
parent 26800 7cac6ee41be7
child 26802 42f705f2c02d
bundlerepo: uncompress changegroup in bundle1 case only Uncompressing bundle2 needs to be handled differently.
mercurial/bundlerepo.py
--- 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 = {}