changeset 50196:2a7e8471782c

bundlerepo: expliclty handing cg part from bundle2 We will handle other types of parts soon (phase-heads) so we need some cleanup first.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Feb 2023 19:02:01 +0100
parents 11e6eee4b063
children c493cb859158
files mercurial/bundlerepo.py
diffstat 1 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Thu Feb 23 15:37:46 2023 +0100
+++ b/mercurial/bundlerepo.py	Thu Feb 23 19:02:01 2023 +0100
@@ -305,8 +305,7 @@
                             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 @@
             [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)