Show More
@@ -334,6 +334,39 b' class compressionengine(formatvariant):' | |||||
334 | def fromconfig(cls, repo): |
|
334 | def fromconfig(cls, repo): | |
335 | return repo.ui.config('experimental', 'format.compression') |
|
335 | return repo.ui.config('experimental', 'format.compression') | |
336 |
|
336 | |||
|
337 | @registerformatvariant | |||
|
338 | class compressionlevel(formatvariant): | |||
|
339 | name = 'compression-level' | |||
|
340 | default = 'default' | |||
|
341 | ||||
|
342 | description = _('compression level') | |||
|
343 | ||||
|
344 | upgrademessage = _('revlog content will be recompressed') | |||
|
345 | ||||
|
346 | @classmethod | |||
|
347 | def fromrepo(cls, repo): | |||
|
348 | comp = compressionengine.fromrepo(repo) | |||
|
349 | level = None | |||
|
350 | if comp == 'zlib': | |||
|
351 | level = repo.ui.configint('storage', 'revlog.zlib.level') | |||
|
352 | elif comp == 'zstd': | |||
|
353 | level = repo.ui.configint('storage', 'revlog.zstd.level') | |||
|
354 | if level is None: | |||
|
355 | return 'default' | |||
|
356 | return bytes(level) | |||
|
357 | ||||
|
358 | @classmethod | |||
|
359 | def fromconfig(cls, repo): | |||
|
360 | comp = compressionengine.fromconfig(repo) | |||
|
361 | level = None | |||
|
362 | if comp == 'zlib': | |||
|
363 | level = repo.ui.configint('storage', 'revlog.zlib.level') | |||
|
364 | elif comp == 'zstd': | |||
|
365 | level = repo.ui.configint('storage', 'revlog.zstd.level') | |||
|
366 | if level is None: | |||
|
367 | return 'default' | |||
|
368 | return bytes(level) | |||
|
369 | ||||
337 | def finddeficiencies(repo): |
|
370 | def finddeficiencies(repo): | |
338 | """returns a list of deficiencies that the repo suffer from""" |
|
371 | """returns a list of deficiencies that the repo suffer from""" | |
339 | deficiencies = [] |
|
372 | deficiencies = [] |
@@ -59,6 +59,7 b' An upgrade of a repository created with ' | |||||
59 | sparserevlog: yes |
|
59 | sparserevlog: yes | |
60 | plain-cl-delta: yes |
|
60 | plain-cl-delta: yes | |
61 | compression: zlib |
|
61 | compression: zlib | |
|
62 | compression-level: default | |||
62 | $ hg debugformat --verbose |
|
63 | $ hg debugformat --verbose | |
63 | format-variant repo config default |
|
64 | format-variant repo config default | |
64 | fncache: yes yes yes |
|
65 | fncache: yes yes yes | |
@@ -67,6 +68,7 b' An upgrade of a repository created with ' | |||||
67 | sparserevlog: yes yes yes |
|
68 | sparserevlog: yes yes yes | |
68 | plain-cl-delta: yes yes yes |
|
69 | plain-cl-delta: yes yes yes | |
69 | compression: zlib zlib zlib |
|
70 | compression: zlib zlib zlib | |
|
71 | compression-level: default default default | |||
70 | $ hg debugformat --verbose --config format.usefncache=no |
|
72 | $ hg debugformat --verbose --config format.usefncache=no | |
71 | format-variant repo config default |
|
73 | format-variant repo config default | |
72 | fncache: yes no yes |
|
74 | fncache: yes no yes | |
@@ -75,6 +77,7 b' An upgrade of a repository created with ' | |||||
75 | sparserevlog: yes yes yes |
|
77 | sparserevlog: yes yes yes | |
76 | plain-cl-delta: yes yes yes |
|
78 | plain-cl-delta: yes yes yes | |
77 | compression: zlib zlib zlib |
|
79 | compression: zlib zlib zlib | |
|
80 | compression-level: default default default | |||
78 | $ hg debugformat --verbose --config format.usefncache=no --color=debug |
|
81 | $ hg debugformat --verbose --config format.usefncache=no --color=debug | |
79 | format-variant repo config default |
|
82 | format-variant repo config default | |
80 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] |
|
83 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes] | |
@@ -83,6 +86,7 b' An upgrade of a repository created with ' | |||||
83 | [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] |
|
86 | [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] | |
84 | [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] |
|
87 | [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] | |
85 | [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] |
|
88 | [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] | |
|
89 | [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default] | |||
86 | $ hg debugformat -Tjson |
|
90 | $ hg debugformat -Tjson | |
87 | [ |
|
91 | [ | |
88 | { |
|
92 | { | |
@@ -120,6 +124,12 b' An upgrade of a repository created with ' | |||||
120 | "default": "zlib", |
|
124 | "default": "zlib", | |
121 | "name": "compression", |
|
125 | "name": "compression", | |
122 | "repo": "zlib" |
|
126 | "repo": "zlib" | |
|
127 | }, | |||
|
128 | { | |||
|
129 | "config": "default", | |||
|
130 | "default": "default", | |||
|
131 | "name": "compression-level", | |||
|
132 | "repo": "default" | |||
123 | } |
|
133 | } | |
124 | ] |
|
134 | ] | |
125 | $ hg debugupgraderepo |
|
135 | $ hg debugupgraderepo | |
@@ -214,6 +224,7 b' Various sub-optimal detections work' | |||||
214 | sparserevlog: no |
|
224 | sparserevlog: no | |
215 | plain-cl-delta: yes |
|
225 | plain-cl-delta: yes | |
216 | compression: zlib |
|
226 | compression: zlib | |
|
227 | compression-level: default | |||
217 | $ hg debugformat --verbose |
|
228 | $ hg debugformat --verbose | |
218 | format-variant repo config default |
|
229 | format-variant repo config default | |
219 | fncache: no yes yes |
|
230 | fncache: no yes yes | |
@@ -222,6 +233,7 b' Various sub-optimal detections work' | |||||
222 | sparserevlog: no yes yes |
|
233 | sparserevlog: no yes yes | |
223 | plain-cl-delta: yes yes yes |
|
234 | plain-cl-delta: yes yes yes | |
224 | compression: zlib zlib zlib |
|
235 | compression: zlib zlib zlib | |
|
236 | compression-level: default default default | |||
225 | $ hg debugformat --verbose --config format.usegeneraldelta=no |
|
237 | $ hg debugformat --verbose --config format.usegeneraldelta=no | |
226 | format-variant repo config default |
|
238 | format-variant repo config default | |
227 | fncache: no yes yes |
|
239 | fncache: no yes yes | |
@@ -230,6 +242,7 b' Various sub-optimal detections work' | |||||
230 | sparserevlog: no no yes |
|
242 | sparserevlog: no no yes | |
231 | plain-cl-delta: yes yes yes |
|
243 | plain-cl-delta: yes yes yes | |
232 | compression: zlib zlib zlib |
|
244 | compression: zlib zlib zlib | |
|
245 | compression-level: default default default | |||
233 | $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug |
|
246 | $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug | |
234 | format-variant repo config default |
|
247 | format-variant repo config default | |
235 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] |
|
248 | [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes] | |
@@ -238,6 +251,7 b' Various sub-optimal detections work' | |||||
238 | [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] |
|
251 | [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes] | |
239 | [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] |
|
252 | [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes] | |
240 | [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] |
|
253 | [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] | |
|
254 | [formatvariant.name.uptodate|compression-level:][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default] | |||
241 | $ hg debugupgraderepo |
|
255 | $ hg debugupgraderepo | |
242 | repository lacks features recommended by current config options: |
|
256 | repository lacks features recommended by current config options: | |
243 |
|
257 |
General Comments 0
You need to be logged in to leave comments.
Login now