# HG changeset patch # User Pierre-Yves David # Date 2023-02-23 18:06:24 # Node ID a6a8946d51739201e3ad196cd55c9bde9f327945 # Parent c493cb859158178053d7842d0fb2459ce308830a 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. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -289,13 +289,16 @@ class bundlerepository: 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 @@ class bundlerepository: _(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,