##// 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 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 = []
@@ -52,37 +52,41 b' An upgrade of a repository created with '
52 $ hg init empty
52 $ hg init empty
53 $ cd empty
53 $ cd empty
54 $ hg debugformat
54 $ hg debugformat
55 format-variant repo
55 format-variant repo
56 fncache: yes
56 fncache: yes
57 dotencode: yes
57 dotencode: yes
58 generaldelta: yes
58 generaldelta: yes
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
65 dotencode: yes yes yes
66 dotencode: yes yes yes
66 generaldelta: yes yes yes
67 generaldelta: yes yes yes
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
73 dotencode: yes no yes
75 dotencode: yes no yes
74 generaldelta: yes yes yes
76 generaldelta: yes yes yes
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]
81 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
84 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
82 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
85 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
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
@@ -207,37 +217,41 b' Various sub-optimal detections work'
207 > EOF
217 > EOF
208
218
209 $ hg debugformat
219 $ hg debugformat
210 format-variant repo
220 format-variant repo
211 fncache: no
221 fncache: no
212 dotencode: no
222 dotencode: no
213 generaldelta: no
223 generaldelta: no
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
220 dotencode: no yes yes
231 dotencode: no yes yes
221 generaldelta: no yes yes
232 generaldelta: no yes yes
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
228 dotencode: no yes yes
240 dotencode: no yes yes
229 generaldelta: no no yes
241 generaldelta: no no yes
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]
236 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
249 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
237 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
250 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
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