Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/bundlerepo.py @ 27751:a40e2f7fe49d
changegroup: hide packermap behind methods
This is to prepare for hiding changegroup3 behind a config option.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 12 Jan 2016 21:01:06 -0800 |
parents | ed41ce89822d |
children | d4071cc73f46 |
comparison
equal
deleted
inserted
replaced
27750:443848eece18 | 27751:a40e2f7fe49d |
---|---|
283 if cgstream is not None: | 283 if cgstream is not None: |
284 raise NotImplementedError("can't process " | 284 raise NotImplementedError("can't process " |
285 "multiple changegroups") | 285 "multiple changegroups") |
286 cgstream = part | 286 cgstream = part |
287 version = part.params.get('version', '01') | 287 version = part.params.get('version', '01') |
288 if version not in changegroup.packermap: | 288 if version not in changegroup.supportedversions(self): |
289 msg = _('Unsupported changegroup version: %s') | 289 msg = _('Unsupported changegroup version: %s') |
290 raise error.Abort(msg % version) | 290 raise error.Abort(msg % version) |
291 if self.bundle.compressed(): | 291 if self.bundle.compressed(): |
292 cgstream = _writetempbundle(part.read, | 292 cgstream = _writetempbundle(part.read, |
293 ".cg%sun" % version) | 293 ".cg%sun" % version) |
294 | 294 |
295 if cgstream is None: | 295 if cgstream is None: |
296 raise error.Abort('No changegroups found') | 296 raise error.Abort('No changegroups found') |
297 cgstream.seek(0) | 297 cgstream.seek(0) |
298 | 298 |
299 self.bundle = changegroup.packermap[version][1](cgstream, 'UN') | 299 self.bundle = changegroup.getunbundler(version, cgstream, 'UN') |
300 | 300 |
301 elif self.bundle.compressed(): | 301 elif self.bundle.compressed(): |
302 f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN') | 302 f = _writetempbundle(self.bundle.read, '.hg10un', header='HG10UN') |
303 self.bundlefile = self.bundle = exchange.readbundle(ui, f, | 303 self.bundlefile = self.bundle = exchange.readbundle(ui, f, |
304 bundlename, | 304 bundlename, |