Show More
@@ -553,9 +553,6 b" coreconfigitem('experimental', 'extended" | |||||
553 | coreconfigitem('experimental', 'extendedheader.similarity', |
|
553 | coreconfigitem('experimental', 'extendedheader.similarity', | |
554 | default=False, |
|
554 | default=False, | |
555 | ) |
|
555 | ) | |
556 | coreconfigitem('experimental', 'format.compression', |
|
|||
557 | default='zlib', |
|
|||
558 | ) |
|
|||
559 | coreconfigitem('experimental', 'graphshorten', |
|
556 | coreconfigitem('experimental', 'graphshorten', | |
560 | default=False, |
|
557 | default=False, | |
561 | ) |
|
558 | ) | |
@@ -684,6 +681,10 b" coreconfigitem('format', 'obsstore-versi" | |||||
684 | coreconfigitem('format', 'sparse-revlog', |
|
681 | coreconfigitem('format', 'sparse-revlog', | |
685 | default=True, |
|
682 | default=True, | |
686 | ) |
|
683 | ) | |
|
684 | coreconfigitem('format', 'revlog-compression', | |||
|
685 | default='zlib', | |||
|
686 | alias=[('experimental', 'format.compression')] | |||
|
687 | ) | |||
687 | coreconfigitem('format', 'usefncache', |
|
688 | coreconfigitem('format', 'usefncache', | |
688 | default=True, |
|
689 | default=True, | |
689 | ) |
|
690 | ) |
@@ -866,6 +866,13 b' https://www.mercurial-scm.org/wiki/Missi' | |||||
866 | Repositories with this on-disk format require Mercurial version 4.7 |
|
866 | Repositories with this on-disk format require Mercurial version 4.7 | |
867 |
|
867 | |||
868 | Enabled by default. |
|
868 | Enabled by default. | |
|
869 | ``revlog-compression`` | |||
|
870 | Compression algorithm used by revlog. Supported value are `zlib` and `zstd`. | |||
|
871 | The `zlib` engine is the historical default of Mercurial. `zstd` is a newer | |||
|
872 | format that is usually a net win over `zlib` operating faster at better | |||
|
873 | compression rate. Use `zstd` to reduce CPU usage. | |||
|
874 | ||||
|
875 | On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`. | |||
869 |
|
876 | |||
870 | ``graph`` |
|
877 | ``graph`` | |
871 | --------- |
|
878 | --------- |
@@ -2920,10 +2920,10 b' def newreporequirements(ui, createopts):' | |||||
2920 | if ui.configbool('format', 'dotencode'): |
|
2920 | if ui.configbool('format', 'dotencode'): | |
2921 | requirements.add('dotencode') |
|
2921 | requirements.add('dotencode') | |
2922 |
|
2922 | |||
2923 |
compengine = ui.config(' |
|
2923 | compengine = ui.config('format', 'revlog-compression') | |
2924 | if compengine not in util.compengines: |
|
2924 | if compengine not in util.compengines: | |
2925 | raise error.Abort(_('compression engine %s defined by ' |
|
2925 | raise error.Abort(_('compression engine %s defined by ' | |
2926 |
' |
|
2926 | 'format.revlog-compression not available') % | |
2927 | compengine, |
|
2927 | compengine, | |
2928 | hint=_('run "hg debuginstall" to list available ' |
|
2928 | hint=_('run "hg debuginstall" to list available ' | |
2929 | 'compression engines')) |
|
2929 | 'compression engines')) |
@@ -332,7 +332,7 b' class compressionengine(formatvariant):' | |||||
332 |
|
332 | |||
333 | @classmethod |
|
333 | @classmethod | |
334 | def fromconfig(cls, repo): |
|
334 | def fromconfig(cls, repo): | |
335 |
return repo.ui.config(' |
|
335 | return repo.ui.config('format', 'revlog-compression') | |
336 |
|
336 | |||
337 | @registerformatvariant |
|
337 | @registerformatvariant | |
338 | class compressionlevel(formatvariant): |
|
338 | class compressionlevel(formatvariant): |
@@ -21,8 +21,8 b' A new repository uses zlib storage, whic' | |||||
21 |
|
21 | |||
22 | Unknown compression engine to format.compression aborts |
|
22 | Unknown compression engine to format.compression aborts | |
23 |
|
23 | |||
24 |
$ hg --config |
|
24 | $ hg --config format.revlog-compression=unknown init unknown | |
25 |
abort: compression engine unknown defined by |
|
25 | abort: compression engine unknown defined by format.revlog-compression not available | |
26 | (run "hg debuginstall" to list available compression engines) |
|
26 | (run "hg debuginstall" to list available compression engines) | |
27 | [255] |
|
27 | [255] | |
28 |
|
28 | |||
@@ -40,7 +40,7 b' A requirement specifying an unknown comp' | |||||
40 |
|
40 | |||
41 | #if zstd |
|
41 | #if zstd | |
42 |
|
42 | |||
43 |
$ hg --config |
|
43 | $ hg --config format.revlog-compression=zstd init zstd | |
44 | $ cd zstd |
|
44 | $ cd zstd | |
45 | $ cat .hg/requires |
|
45 | $ cat .hg/requires | |
46 | dotencode |
|
46 | dotencode | |
@@ -66,7 +66,7 b' with that engine or a requirement' | |||||
66 |
|
66 | |||
67 | $ cd default |
|
67 | $ cd default | |
68 | $ touch bar |
|
68 | $ touch bar | |
69 |
$ hg --config |
|
69 | $ hg --config format.revlog-compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text' | |
70 |
|
70 | |||
71 | $ cat .hg/requires |
|
71 | $ cat .hg/requires | |
72 | dotencode |
|
72 | dotencode | |
@@ -141,13 +141,13 b' Test error cases' | |||||
141 | checking zstd options |
|
141 | checking zstd options | |
142 | ===================== |
|
142 | ===================== | |
143 |
|
143 | |||
144 |
$ hg init zstd-level-default --config |
|
144 | $ hg init zstd-level-default --config format.revlog-compression=zstd | |
145 |
$ hg init zstd-level-1 --config |
|
145 | $ hg init zstd-level-1 --config format.revlog-compression=zstd | |
146 | $ cat << EOF >> zstd-level-1/.hg/hgrc |
|
146 | $ cat << EOF >> zstd-level-1/.hg/hgrc | |
147 | > [storage] |
|
147 | > [storage] | |
148 | > revlog.zstd.level=1 |
|
148 | > revlog.zstd.level=1 | |
149 | > EOF |
|
149 | > EOF | |
150 |
$ hg init zstd-level-22 --config |
|
150 | $ hg init zstd-level-22 --config format.revlog-compression=zstd | |
151 | $ cat << EOF >> zstd-level-22/.hg/hgrc |
|
151 | $ cat << EOF >> zstd-level-22/.hg/hgrc | |
152 | > [storage] |
|
152 | > [storage] | |
153 | > revlog.zstd.level=22 |
|
153 | > revlog.zstd.level=22 | |
@@ -172,7 +172,7 b' checking zstd options' | |||||
172 |
|
172 | |||
173 | Test error cases |
|
173 | Test error cases | |
174 |
|
174 | |||
175 |
$ hg init zstd-level-invalid --config |
|
175 | $ hg init zstd-level-invalid --config format.revlog-compression=zstd | |
176 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc |
|
176 | $ cat << EOF >> zstd-level-invalid/.hg/hgrc | |
177 | > [storage] |
|
177 | > [storage] | |
178 | > revlog.zstd.level=foobar |
|
178 | > revlog.zstd.level=foobar | |
@@ -182,7 +182,7 b' Test error cases' | |||||
182 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') |
|
182 | abort: storage.revlog.zstd.level is not a valid integer ('foobar') | |
183 | [255] |
|
183 | [255] | |
184 |
|
184 | |||
185 |
$ hg init zstd-level-out-of-range --config |
|
185 | $ hg init zstd-level-out-of-range --config format.revlog-compression=zstd | |
186 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc |
|
186 | $ cat << EOF >> zstd-level-out-of-range/.hg/hgrc | |
187 | > [storage] |
|
187 | > [storage] | |
188 | > revlog.zstd.level=42 |
|
188 | > revlog.zstd.level=42 |
General Comments 0
You need to be logged in to leave comments.
Login now