changeset 26801:73bf76bf6f14

bundlerepo: uncompress changegroup in bundle1 case only Uncompressing bundle2 needs to be handled differently.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 19 Oct 2015 18:04:08 +0200
parents 7cac6ee41be7
children 42f705f2c02d
files mercurial/bundlerepo.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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 = {}