##// END OF EJS Templates
compression: display compression level in debugformat...
marmoute -
r42212:d7e751ec default
parent child Browse files
Show More
@@ -334,6 +334,39 b' class compressionengine(formatvariant):'
334 334 def fromconfig(cls, repo):
335 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 370 def finddeficiencies(repo):
338 371 """returns a list of deficiencies that the repo suffer from"""
339 372 deficiencies = []
@@ -59,6 +59,7 b' An upgrade of a repository created with '
59 59 sparserevlog: yes
60 60 plain-cl-delta: yes
61 61 compression: zlib
62 compression-level: default
62 63 $ hg debugformat --verbose
63 64 format-variant repo config default
64 65 fncache: yes yes yes
@@ -67,6 +68,7 b' An upgrade of a repository created with '
67 68 sparserevlog: yes yes yes
68 69 plain-cl-delta: yes yes yes
69 70 compression: zlib zlib zlib
71 compression-level: default default default
70 72 $ hg debugformat --verbose --config format.usefncache=no
71 73 format-variant repo config default
72 74 fncache: yes no yes
@@ -75,6 +77,7 b' An upgrade of a repository created with '
75 77 sparserevlog: yes yes yes
76 78 plain-cl-delta: yes yes yes
77 79 compression: zlib zlib zlib
80 compression-level: default default default
78 81 $ hg debugformat --verbose --config format.usefncache=no --color=debug
79 82 format-variant repo config default
80 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 86 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
84 87 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
85 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 90 $ hg debugformat -Tjson
87 91 [
88 92 {
@@ -120,6 +124,12 b' An upgrade of a repository created with '
120 124 "default": "zlib",
121 125 "name": "compression",
122 126 "repo": "zlib"
127 },
128 {
129 "config": "default",
130 "default": "default",
131 "name": "compression-level",
132 "repo": "default"
123 133 }
124 134 ]
125 135 $ hg debugupgraderepo
@@ -214,6 +224,7 b' Various sub-optimal detections work'
214 224 sparserevlog: no
215 225 plain-cl-delta: yes
216 226 compression: zlib
227 compression-level: default
217 228 $ hg debugformat --verbose
218 229 format-variant repo config default
219 230 fncache: no yes yes
@@ -222,6 +233,7 b' Various sub-optimal detections work'
222 233 sparserevlog: no yes yes
223 234 plain-cl-delta: yes yes yes
224 235 compression: zlib zlib zlib
236 compression-level: default default default
225 237 $ hg debugformat --verbose --config format.usegeneraldelta=no
226 238 format-variant repo config default
227 239 fncache: no yes yes
@@ -230,6 +242,7 b' Various sub-optimal detections work'
230 242 sparserevlog: no no yes
231 243 plain-cl-delta: yes yes yes
232 244 compression: zlib zlib zlib
245 compression-level: default default default
233 246 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
234 247 format-variant repo config default
235 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 251 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
239 252 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
240 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 255 $ hg debugupgraderepo
242 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