##// END OF EJS Templates
bundlerepo: properly extract compressed changegroup from bundle2...
Pierre-Yves David -
r26803:ed41ce89 default
parent child Browse files
Show More
@@ -277,22 +277,26 b' class bundlerepository(localrepo.localre'
277 self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename)
277 self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename)
278
278
279 if isinstance(self.bundle, bundle2.unbundle20):
279 if isinstance(self.bundle, bundle2.unbundle20):
280 cgparts = [part for part in self.bundle.iterparts()
280 cgstream = None
281 if (part.type == 'changegroup')
281 for part in self.bundle.iterparts():
282 and (part.params.get('version', '01')
282 if part.type == 'changegroup':
283 in changegroup.packermap)]
283 if cgstream is not None:
284 raise NotImplementedError("can't process "
285 "multiple changegroups")
286 cgstream = part
287 version = part.params.get('version', '01')
288 if version not in changegroup.packermap:
289 msg = _('Unsupported changegroup version: %s')
290 raise error.Abort(msg % version)
291 if self.bundle.compressed():
292 cgstream = _writetempbundle(part.read,
293 ".cg%sun" % version)
284
294
285 if not cgparts:
295 if cgstream is None:
286 raise error.Abort('No changegroups found')
296 raise error.Abort('No changegroups found')
287 version = cgparts[0].params.get('version', '01')
297 cgstream.seek(0)
288 cgparts = [p for p in cgparts
289 if p.params.get('version', '01') == version]
290 if len(cgparts) > 1:
291 raise NotImplementedError("Can't process multiple changegroups")
292 part = cgparts[0]
293
298
294 part.seek(0)
299 self.bundle = changegroup.packermap[version][1](cgstream, 'UN')
295 self.bundle = changegroup.packermap[version][1](part, 'UN')
296
300
297 elif self.bundle.compressed():
301 elif self.bundle.compressed():
298 f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN')
302 f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN')
General Comments 0
You need to be logged in to leave comments. Login now