Show More
@@ -277,22 +277,26 b' class bundlerepository(localrepo.localre' | |||
|
277 | 277 | self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename) |
|
278 | 278 | |
|
279 | 279 | if isinstance(self.bundle, bundle2.unbundle20): |
|
280 | cgparts = [part for part in self.bundle.iterparts() | |
|
281 | if (part.type == 'changegroup') | |
|
282 | and (part.params.get('version', '01') | |
|
283 | in changegroup.packermap)] | |
|
280 | cgstream = None | |
|
281 | for part in self.bundle.iterparts(): | |
|
282 | if part.type == 'changegroup': | |
|
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 |
|
|
295 | if cgstream is None: | |
|
286 | 296 | raise error.Abort('No changegroups found') |
|
287 | version = cgparts[0].params.get('version', '01') | |
|
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] | |
|
297 | cgstream.seek(0) | |
|
293 | 298 | |
|
294 | part.seek(0) | |
|
295 | self.bundle = changegroup.packermap[version][1](part, 'UN') | |
|
299 | self.bundle = changegroup.packermap[version][1](cgstream, 'UN') | |
|
296 | 300 | |
|
297 | 301 | elif self.bundle.compressed(): |
|
298 | 302 | f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN') |
General Comments 0
You need to be logged in to leave comments.
Login now