Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 51037:7d66621c5349
revlog: skip opener options to pass compression option values
We can directly set the option in the config object now.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 10 Oct 2023 10:03:34 +0200 |
parents | 940445de2b09 |
children | 683b96c416d8 |
comparison
equal
deleted
inserted
replaced
51036:940445de2b09 | 51037:7d66621c5349 |
---|---|
1149 # The compression used for new entries will be "the last one" | 1149 # The compression used for new entries will be "the last one" |
1150 prefix = r.startswith | 1150 prefix = r.startswith |
1151 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'): | 1151 if prefix(b'revlog-compression-') or prefix(b'exp-compression-'): |
1152 feature_config.compression_engine = r.split(b'-', 2)[2] | 1152 feature_config.compression_engine = r.split(b'-', 2)[2] |
1153 | 1153 |
1154 options[b'zlib.level'] = ui.configint(b'storage', b'revlog.zlib.level') | 1154 zlib_level = ui.configint(b'storage', b'revlog.zlib.level') |
1155 if options[b'zlib.level'] is not None: | 1155 if zlib_level is not None: |
1156 if not (0 <= options[b'zlib.level'] <= 9): | 1156 if not (0 <= zlib_level <= 9): |
1157 msg = _(b'invalid value for `storage.revlog.zlib.level` config: %d') | 1157 msg = _(b'invalid value for `storage.revlog.zlib.level` config: %d') |
1158 raise error.Abort(msg % options[b'zlib.level']) | 1158 raise error.Abort(msg % zlib_level) |
1159 options[b'zstd.level'] = ui.configint(b'storage', b'revlog.zstd.level') | 1159 feature_config.compression_engine_options[b'zlib.level'] = zlib_level |
1160 if options[b'zstd.level'] is not None: | 1160 zstd_level = ui.configint(b'storage', b'revlog.zstd.level') |
1161 if not (0 <= options[b'zstd.level'] <= 22): | 1161 if zstd_level is not None: |
1162 if not (0 <= zstd_level <= 22): | |
1162 msg = _(b'invalid value for `storage.revlog.zstd.level` config: %d') | 1163 msg = _(b'invalid value for `storage.revlog.zstd.level` config: %d') |
1163 raise error.Abort(msg % options[b'zstd.level']) | 1164 raise error.Abort(msg % zstd_level) |
1165 feature_config.compression_engine_options[b'zstd.level'] = zstd_level | |
1164 | 1166 |
1165 if requirementsmod.NARROW_REQUIREMENT in requirements: | 1167 if requirementsmod.NARROW_REQUIREMENT in requirements: |
1166 options[b'enableellipsis'] = True | 1168 options[b'enableellipsis'] = True |
1167 | 1169 |
1168 if ui.configbool(b'experimental', b'rust.index'): | 1170 if ui.configbool(b'experimental', b'rust.index'): |