##// END OF EJS Templates
upgrade: register compression as a format variants...
Boris Feld -
r35341:ead01b74 default
parent child Browse files
Show More
@@ -284,6 +284,28 b' class removecldeltachain(formatvariant):'
284 def fromconfig(repo):
284 def fromconfig(repo):
285 return True
285 return True
286
286
287 @registerformatvariant
288 class compressionengine(formatvariant):
289 name = 'compression'
290 default = 'zlib'
291
292 description = _('Compresion algorithm used to compress data. '
293 'Some engine are faster than other')
294
295 upgrademessage = _('revlog content will be recompressed with the new '
296 'algorithm.')
297
298 @classmethod
299 def fromrepo(cls, repo):
300 for req in repo.requirements:
301 if req.startswith('exp-compression-'):
302 return req.split('-', 2)[2]
303 return 'zlib'
304
305 @classmethod
306 def fromconfig(cls, repo):
307 return repo.ui.config('experimental', 'format.compression')
308
287 def finddeficiencies(repo):
309 def finddeficiencies(repo):
288 """returns a list of deficiencies that the repo suffer from"""
310 """returns a list of deficiencies that the repo suffer from"""
289 deficiencies = []
311 deficiencies = []
@@ -60,24 +60,28 b' An upgrade of a repository created with '
60 dotencode: yes
60 dotencode: yes
61 generaldelta: yes
61 generaldelta: yes
62 plain-cl-delta: yes
62 plain-cl-delta: yes
63 compression: zlib
63 $ hg debugformat --verbose
64 $ hg debugformat --verbose
64 format-variant repo config default
65 format-variant repo config default
65 fncache: yes yes yes
66 fncache: yes yes yes
66 dotencode: yes yes yes
67 dotencode: yes yes yes
67 generaldelta: yes yes yes
68 generaldelta: yes yes yes
68 plain-cl-delta: yes yes yes
69 plain-cl-delta: yes yes yes
70 compression: zlib zlib zlib
69 $ hg debugformat --verbose --config format.usegfncache=no
71 $ hg debugformat --verbose --config format.usegfncache=no
70 format-variant repo config default
72 format-variant repo config default
71 fncache: yes yes yes
73 fncache: yes yes yes
72 dotencode: yes yes yes
74 dotencode: yes yes yes
73 generaldelta: yes yes yes
75 generaldelta: yes yes yes
74 plain-cl-delta: yes yes yes
76 plain-cl-delta: yes yes yes
77 compression: zlib zlib zlib
75 $ hg debugformat --verbose --config format.usegfncache=no --color=debug
78 $ hg debugformat --verbose --config format.usegfncache=no --color=debug
76 format-variant repo config default
79 format-variant repo config default
77 [formatvariant.name.uptodate|fncache: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
80 [formatvariant.name.uptodate|fncache: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
78 [formatvariant.name.uptodate|dotencode: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
81 [formatvariant.name.uptodate|dotencode: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
79 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
82 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
80 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
83 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
84 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
81 $ hg debugupgraderepo
85 $ hg debugupgraderepo
82 (no feature deficiencies found in existing repository)
86 (no feature deficiencies found in existing repository)
83 performing an upgrade with "--run" will make the following changes:
87 performing an upgrade with "--run" will make the following changes:
@@ -131,24 +135,28 b' Various sub-optimal detections work'
131 dotencode: no
135 dotencode: no
132 generaldelta: no
136 generaldelta: no
133 plain-cl-delta: yes
137 plain-cl-delta: yes
138 compression: zlib
134 $ hg debugformat --verbose
139 $ hg debugformat --verbose
135 format-variant repo config default
140 format-variant repo config default
136 fncache: no yes yes
141 fncache: no yes yes
137 dotencode: no yes yes
142 dotencode: no yes yes
138 generaldelta: no yes yes
143 generaldelta: no yes yes
139 plain-cl-delta: yes yes yes
144 plain-cl-delta: yes yes yes
145 compression: zlib zlib zlib
140 $ hg debugformat --verbose --config format.usegeneraldelta=no
146 $ hg debugformat --verbose --config format.usegeneraldelta=no
141 format-variant repo config default
147 format-variant repo config default
142 fncache: no yes yes
148 fncache: no yes yes
143 dotencode: no yes yes
149 dotencode: no yes yes
144 generaldelta: no no yes
150 generaldelta: no no yes
145 plain-cl-delta: yes yes yes
151 plain-cl-delta: yes yes yes
152 compression: zlib zlib zlib
146 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
153 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
147 format-variant repo config default
154 format-variant repo config default
148 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
155 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
149 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
156 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
150 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
157 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
151 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
158 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
159 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
152 $ hg debugupgraderepo
160 $ hg debugupgraderepo
153 repository lacks features recommended by current config options:
161 repository lacks features recommended by current config options:
154
162
General Comments 0
You need to be logged in to leave comments. Login now