# HG changeset patch # User Pierre-Yves David # Date 2023-02-23 18:02:01 # Node ID 2a7e8471782c2b79539350b4e1f5032ae186c22b # Parent 11e6eee4b0633b82c7d3442102682d55d7013222 bundlerepo: expliclty handing cg part from bundle2 We will handle other types of parts soon (phase-heads) so we need some cleanup first. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -305,8 +305,7 @@ class bundlerepository: b"can't process multiple changegroups" ) cgpart = part - - self._handlebundle2part(bundle, part) + self._handle_bundle2_cg_part(bundle, part) if not cgpart: raise error.Abort(_(b"No changegroups found")) @@ -343,10 +342,8 @@ class bundlerepository: [ctx.node() for ctx in self[self.firstnewrev :]], ) - def _handlebundle2part(self, bundle, part): - if part.type != b'changegroup': - return - + def _handle_bundle2_cg_part(self, bundle, part): + assert part.type == b'changegroup' cgstream = part version = part.params.get(b'version', b'01') legalcgvers = changegroup.supportedincomingversions(self)