Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/revlog.py @ 51138:c136c797740e stable
revlog: allow explicit passing of config to revlog
This will be useful to fix censor in a later changeset.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 02 Dec 2023 02:11:20 +0100 |
parents | 98910135a3bc |
children | e9eac01c57f3 |
comparison
equal
deleted
inserted
replaced
51137:22d11305f365 | 51138:c136c797740e |
---|---|
1303 persistentnodemap=False, | 1303 persistentnodemap=False, |
1304 concurrencychecker=None, | 1304 concurrencychecker=None, |
1305 trypending=False, | 1305 trypending=False, |
1306 try_split=False, | 1306 try_split=False, |
1307 canonical_parent_order=True, | 1307 canonical_parent_order=True, |
1308 data_config=None, | |
1309 delta_config=None, | |
1310 feature_config=None, | |
1308 ): | 1311 ): |
1309 """ | 1312 """ |
1310 create a revlog object | 1313 create a revlog object |
1311 | 1314 |
1312 opener is a function that abstracts the file opening operation | 1315 opener is a function that abstracts the file opening operation |
1335 self._nodemap_file = nodemaputil.get_nodemap_file(self) | 1338 self._nodemap_file = nodemaputil.get_nodemap_file(self) |
1336 | 1339 |
1337 assert target[0] in ALL_KINDS | 1340 assert target[0] in ALL_KINDS |
1338 assert len(target) == 2 | 1341 assert len(target) == 2 |
1339 self.target = target | 1342 self.target = target |
1340 if b'feature-config' in self.opener.options: | 1343 if feature_config is not None: |
1344 self.feature_config = feature_config.copy() | |
1345 elif b'feature-config' in self.opener.options: | |
1341 self.feature_config = self.opener.options[b'feature-config'].copy() | 1346 self.feature_config = self.opener.options[b'feature-config'].copy() |
1342 else: | 1347 else: |
1343 self.feature_config = FeatureConfig() | 1348 self.feature_config = FeatureConfig() |
1344 self.feature_config.censorable = censorable | 1349 self.feature_config.censorable = censorable |
1345 self.feature_config.canonical_parent_order = canonical_parent_order | 1350 self.feature_config.canonical_parent_order = canonical_parent_order |
1346 if b'data-config' in self.opener.options: | 1351 if data_config is not None: |
1352 self.data_config = data_config.copy() | |
1353 elif b'data-config' in self.opener.options: | |
1347 self.data_config = self.opener.options[b'data-config'].copy() | 1354 self.data_config = self.opener.options[b'data-config'].copy() |
1348 else: | 1355 else: |
1349 self.data_config = DataConfig() | 1356 self.data_config = DataConfig() |
1350 self.data_config.check_ambig = checkambig | 1357 self.data_config.check_ambig = checkambig |
1351 self.data_config.mmap_large_index = mmaplargeindex | 1358 self.data_config.mmap_large_index = mmaplargeindex |
1352 if b'delta-config' in self.opener.options: | 1359 if delta_config is not None: |
1360 self.delta_config = delta_config.copy() | |
1361 elif b'delta-config' in self.opener.options: | |
1353 self.delta_config = self.opener.options[b'delta-config'].copy() | 1362 self.delta_config = self.opener.options[b'delta-config'].copy() |
1354 else: | 1363 else: |
1355 self.delta_config = DeltaConfig() | 1364 self.delta_config = DeltaConfig() |
1356 self.delta_config.upper_bound_comp = upperboundcomp | 1365 self.delta_config.upper_bound_comp = upperboundcomp |
1357 | 1366 |