# HG changeset patch # User Pierre-Yves David # Date 2023-10-10 08:04:06 # Node ID e2941c398f10fc124c8d00a936c6ac047161265a # Parent 8ed03f773eace9482be1805c77007cc6459d0c70 revlog: skip opener options to pass sparse reading values We can directly set the option in the config object now. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1125,14 +1125,15 @@ def resolverevlogstorevfsoptions(ui, req ui.config(b'experimental', b'sparse-read.density-threshold') ) srmingapsize = ui.configbytes(b'experimental', b'sparse-read.min-gap-size') - options[b'with-sparse-read'] = withsparseread - options[b'sparse-read-density-threshold'] = srdensitythres - options[b'sparse-read-min-gap-size'] = srmingapsize + data_config.with_sparse_read = withsparseread + data_config.sr_density_threshold = srdensitythres + data_config.sr_min_gap_size = srmingapsize sparserevlog = requirementsmod.SPARSEREVLOG_REQUIREMENT in requirements delta_config.sparse_revlog = sparserevlog if sparserevlog: options[b'generaldelta'] = True + data_config.with_sparse_read = True maxchainlen = None if sparserevlog: diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -630,17 +630,6 @@ class revlog: mmapindexthreshold = None if self._mmaplargeindex: mmapindexthreshold = self.data_config.mmap_index_threshold - if self.delta_config.sparse_revlog: - # sparse-revlog forces sparse-read - self.data_config.with_sparse_read = True - elif b'with-sparse-read' in opts: - self.data_config.with_sparse_read = bool(opts[b'with-sparse-read']) - if b'sparse-read-density-threshold' in opts: - self.data_config.sr_density_threshold = opts[ - b'sparse-read-density-threshold' - ] - if b'sparse-read-min-gap-size' in opts: - self.data_config.sr_min_gap_size = opts[b'sparse-read-min-gap-size'] if self.feature_config.enable_ellipsis: self._flagprocessors[REVIDX_ELLIPSIS] = ellipsisprocessor