changeset 50237:a6a8946d5173

bundlerepo: move most attribute declaration earlier in __init__ The expected attribute are clearer this way. The bundle handling code is responsible for setting most of it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 23 Feb 2023 19:06:24 +0100
parents c493cb859158
children 21f876895dfe
files mercurial/bundlerepo.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bundlerepo.py	Thu Feb 23 19:04:44 2023 +0100
+++ b/mercurial/bundlerepo.py	Thu Feb 23 19:06:24 2023 +0100
@@ -289,13 +289,16 @@
 
         self.ui.setconfig(b'phases', b'publish', False, b'bundlerepo')
 
+        # dict with the mapping 'filename' -> position in the changegroup.
+        self._cgfilespos = {}
+        self._bundlefile = None
+        self._cgunpacker = None
         self.tempfile = None
         f = util.posixfile(bundlepath, b"rb")
         bundle = exchange.readbundle(self.ui, f, bundlepath)
 
         if isinstance(bundle, bundle2.unbundle20):
             self._bundlefile = bundle
-            self._cgunpacker = None
 
             cgpart = None
             for part in bundle.iterparts(seekable=True):
@@ -324,9 +327,6 @@
                 _(b'bundle type %s cannot be read') % type(bundle)
             )
 
-        # dict with the mapping 'filename' -> position in the changegroup.
-        self._cgfilespos = {}
-
         self.firstnewrev = self.changelog.repotiprev + 1
         phases.retractboundary(
             self,