##// END OF EJS Templates
upgrade: issue a message when a revlog type has to be upgraded...
marmoute -
r49276:8405c1bf default
parent child Browse files
Show More
@@ -1,399 +1,419 b''
1 1 # upgrade.py - functions for in place upgrade of Mercurial repository
2 2 #
3 3 # Copyright (c) 2016-present, Gregory Szorc
4 4 #
5 5 # This software may be used and distributed according to the terms of the
6 6 # GNU General Public License version 2 or any later version.
7 7
8 8 from __future__ import absolute_import
9 9
10 10 from .i18n import _
11 11 from . import (
12 12 error,
13 13 hg,
14 14 localrepo,
15 15 lock as lockmod,
16 16 pycompat,
17 17 requirements as requirementsmod,
18 18 scmutil,
19 19 )
20 20
21 21 from .upgrade_utils import (
22 22 actions as upgrade_actions,
23 23 engine as upgrade_engine,
24 24 )
25 25
26 26 from .utils import (
27 27 stringutil,
28 28 )
29 29
30 30 allformatvariant = upgrade_actions.allformatvariant
31 31
32 32
33 33 def upgraderepo(
34 34 ui,
35 35 repo,
36 36 run=False,
37 37 optimize=None,
38 38 backup=True,
39 39 manifest=None,
40 40 changelog=None,
41 41 filelogs=None,
42 42 ):
43 43 """Upgrade a repository in place."""
44 44 if optimize is None:
45 45 optimize = {}
46 46 repo = repo.unfiltered()
47 47
48 48 specified_revlogs = {}
49 49 if changelog is not None:
50 50 specified_revlogs[upgrade_engine.UPGRADE_CHANGELOG] = changelog
51 51 if manifest is not None:
52 52 specified_revlogs[upgrade_engine.UPGRADE_MANIFEST] = manifest
53 53 if filelogs is not None:
54 54 specified_revlogs[upgrade_engine.UPGRADE_FILELOGS] = filelogs
55 55
56 56 # Ensure the repository can be upgraded.
57 57 upgrade_actions.check_source_requirements(repo)
58 58
59 59 default_options = localrepo.defaultcreateopts(repo.ui)
60 60 newreqs = localrepo.newreporequirements(repo.ui, default_options)
61 61 newreqs.update(upgrade_actions.preservedrequirements(repo))
62 62
63 63 upgrade_actions.check_requirements_changes(repo, newreqs)
64 64
65 65 # Find and validate all improvements that can be made.
66 66 alloptimizations = upgrade_actions.findoptimizations(repo)
67 67
68 68 # Apply and Validate arguments.
69 69 optimizations = []
70 70 for o in alloptimizations:
71 71 if o.name in optimize:
72 72 optimizations.append(o)
73 73 optimize.discard(o.name)
74 74
75 75 if optimize: # anything left is unknown
76 76 raise error.Abort(
77 77 _(b'unknown optimization action requested: %s')
78 78 % b', '.join(sorted(optimize)),
79 79 hint=_(b'run without arguments to see valid optimizations'),
80 80 )
81 81
82 82 format_upgrades = upgrade_actions.find_format_upgrades(repo)
83 83 up_actions = upgrade_actions.determine_upgrade_actions(
84 84 repo, format_upgrades, optimizations, repo.requirements, newreqs
85 85 )
86 86 removed_actions = upgrade_actions.find_format_downgrades(repo)
87 87
88 88 removedreqs = repo.requirements - newreqs
89 89 addedreqs = newreqs - repo.requirements
90 90
91 91 # check if we need to touch revlog and if so, which ones
92 92
93 93 touched_revlogs = set()
94 94 overwrite_msg = _(b'warning: ignoring %14s, as upgrade is changing: %s\n')
95 msg_issued = False
95 select_msg = _(b'note: selecting %s for processing to change: %s\n')
96 msg_issued = 0
96 97
97 98 FL = upgrade_engine.UPGRADE_FILELOGS
98 99 MN = upgrade_engine.UPGRADE_MANIFEST
99 100 CL = upgrade_engine.UPGRADE_CHANGELOG
100 101
101 102 for action in sorted(up_actions + removed_actions, key=lambda a: a.name):
102 103 # optimisation does not "requires anything, they just needs it.
103 104 if action.type != upgrade_actions.FORMAT_VARIANT:
104 105 continue
105 106
106 107 if action.touches_filelogs and FL not in touched_revlogs:
107 108 if FL in specified_revlogs:
108 109 if not specified_revlogs[FL]:
109 110 msg = overwrite_msg % (b'--no-filelogs', action.name)
110 111 ui.warn(msg)
111 msg_issued = True
112 msg_issued = 2
113 else:
114 msg = select_msg % (b'all-filelogs', action.name)
115 ui.status(msg)
116 if not ui.quiet:
117 msg_issued = 1
112 118 touched_revlogs.add(FL)
119
113 120 if action.touches_manifests and MN not in touched_revlogs:
114 121 if MN in specified_revlogs:
115 122 if not specified_revlogs[MN]:
116 123 msg = overwrite_msg % (b'--no-manifest', action.name)
117 124 ui.warn(msg)
118 msg_issued = True
125 msg_issued = 2
126 else:
127 msg = select_msg % (b'all-manifestlogs', action.name)
128 ui.status(msg)
129 if not ui.quiet:
130 msg_issued = 1
119 131 touched_revlogs.add(MN)
132
120 133 if action.touches_changelog and CL not in touched_revlogs:
121 134 if CL in specified_revlogs:
122 135 if not specified_revlogs[CL]:
123 136 msg = overwrite_msg % (b'--no-changelog', action.name)
124 137 ui.warn(msg)
125 138 msg_issued = True
139 else:
140 msg = select_msg % (b'changelog', action.name)
141 ui.status(msg)
142 if not ui.quiet:
143 msg_issued = 1
126 144 touched_revlogs.add(CL)
127 if msg_issued:
145 if msg_issued >= 2:
128 146 ui.warn((b"\n"))
147 elif msg_issued >= 1:
148 ui.status((b"\n"))
129 149
130 150 revlogs = set(upgrade_engine.UPGRADE_ALL_REVLOGS)
131 151 if specified_revlogs:
132 152 # we have some limitation on revlogs to be recloned
133 153 if any(specified_revlogs.values()):
134 154 revlogs = set()
135 155 for upgrade, enabled in specified_revlogs.items():
136 156 if enabled:
137 157 revlogs.add(upgrade)
138 158 else:
139 159 # none are enabled
140 160 for upgrade in specified_revlogs.keys():
141 161 revlogs.discard(upgrade)
142 162
143 163 # check the consistency of the revlog selection with the planned action
144 164
145 165 if revlogs != upgrade_engine.UPGRADE_ALL_REVLOGS:
146 166 incompatible = upgrade_actions.RECLONES_REQUIREMENTS & (
147 167 removedreqs | addedreqs
148 168 )
149 169 if incompatible:
150 170 msg = _(
151 171 b'ignoring revlogs selection flags, format requirements '
152 172 b'change: %s\n'
153 173 )
154 174 ui.warn(msg % b', '.join(sorted(incompatible)))
155 175 revlogs = upgrade_engine.UPGRADE_ALL_REVLOGS
156 176
157 177 upgrade_op = upgrade_actions.UpgradeOperation(
158 178 ui,
159 179 newreqs,
160 180 repo.requirements,
161 181 up_actions,
162 182 removed_actions,
163 183 revlogs,
164 184 backup,
165 185 )
166 186
167 187 if not run:
168 188 fromconfig = []
169 189 onlydefault = []
170 190
171 191 for d in format_upgrades:
172 192 if d.fromconfig(repo):
173 193 fromconfig.append(d)
174 194 elif d.default:
175 195 onlydefault.append(d)
176 196
177 197 if fromconfig or onlydefault:
178 198
179 199 if fromconfig:
180 200 ui.status(
181 201 _(
182 202 b'repository lacks features recommended by '
183 203 b'current config options:\n\n'
184 204 )
185 205 )
186 206 for i in fromconfig:
187 207 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
188 208
189 209 if onlydefault:
190 210 ui.status(
191 211 _(
192 212 b'repository lacks features used by the default '
193 213 b'config options:\n\n'
194 214 )
195 215 )
196 216 for i in onlydefault:
197 217 ui.status(b'%s\n %s\n\n' % (i.name, i.description))
198 218
199 219 ui.status(b'\n')
200 220 else:
201 221 ui.status(_(b'(no format upgrades found in existing repository)\n'))
202 222
203 223 ui.status(
204 224 _(
205 225 b'performing an upgrade with "--run" will make the following '
206 226 b'changes:\n\n'
207 227 )
208 228 )
209 229
210 230 upgrade_op.print_requirements()
211 231 upgrade_op.print_optimisations()
212 232 upgrade_op.print_upgrade_actions()
213 233 upgrade_op.print_affected_revlogs()
214 234
215 235 if upgrade_op.unused_optimizations:
216 236 ui.status(
217 237 _(
218 238 b'additional optimizations are available by specifying '
219 239 b'"--optimize <name>":\n\n'
220 240 )
221 241 )
222 242 upgrade_op.print_unused_optimizations()
223 243 return
224 244
225 245 if not (upgrade_op.upgrade_actions or upgrade_op.removed_actions):
226 246 ui.status(_(b'nothing to do\n'))
227 247 return
228 248 # Else we're in the run=true case.
229 249 ui.write(_(b'upgrade will perform the following actions:\n\n'))
230 250 upgrade_op.print_requirements()
231 251 upgrade_op.print_optimisations()
232 252 upgrade_op.print_upgrade_actions()
233 253 upgrade_op.print_affected_revlogs()
234 254
235 255 ui.status(_(b'beginning upgrade...\n'))
236 256 with repo.wlock(), repo.lock():
237 257 ui.status(_(b'repository locked and read-only\n'))
238 258 # Our strategy for upgrading the repository is to create a new,
239 259 # temporary repository, write data to it, then do a swap of the
240 260 # data. There are less heavyweight ways to do this, but it is easier
241 261 # to create a new repo object than to instantiate all the components
242 262 # (like the store) separately.
243 263 tmppath = pycompat.mkdtemp(prefix=b'upgrade.', dir=repo.path)
244 264 backuppath = None
245 265 try:
246 266 ui.status(
247 267 _(
248 268 b'creating temporary repository to stage upgraded '
249 269 b'data: %s\n'
250 270 )
251 271 % tmppath
252 272 )
253 273
254 274 # clone ui without using ui.copy because repo.ui is protected
255 275 repoui = repo.ui.__class__(repo.ui)
256 276 dstrepo = hg.repository(repoui, path=tmppath, create=True)
257 277
258 278 with dstrepo.wlock(), dstrepo.lock():
259 279 backuppath = upgrade_engine.upgrade(
260 280 ui, repo, dstrepo, upgrade_op
261 281 )
262 282
263 283 finally:
264 284 ui.status(_(b'removing temporary repository %s\n') % tmppath)
265 285 repo.vfs.rmtree(tmppath, forcibly=True)
266 286
267 287 if backuppath and not ui.quiet:
268 288 ui.warn(
269 289 _(b'copy of old repository backed up at %s\n') % backuppath
270 290 )
271 291 ui.warn(
272 292 _(
273 293 b'the old repository will not be deleted; remove '
274 294 b'it to free up disk space once the upgraded '
275 295 b'repository is verified\n'
276 296 )
277 297 )
278 298
279 299 upgrade_op.print_post_op_messages()
280 300
281 301
282 302 def upgrade_share_to_safe(
283 303 ui,
284 304 hgvfs,
285 305 storevfs,
286 306 current_requirements,
287 307 mismatch_config,
288 308 mismatch_warn,
289 309 ):
290 310 """Upgrades a share to use share-safe mechanism"""
291 311 wlock = None
292 312 store_requirements = localrepo._readrequires(storevfs, False)
293 313 original_crequirements = current_requirements.copy()
294 314 # after upgrade, store requires will be shared, so lets find
295 315 # the requirements which are not present in store and
296 316 # write them to share's .hg/requires
297 317 diffrequires = current_requirements - store_requirements
298 318 # add share-safe requirement as it will mark the share as share-safe
299 319 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
300 320 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
301 321 # in `allow` case, we don't try to upgrade, we just respect the source
302 322 # state, update requirements and continue
303 323 if mismatch_config == b'allow':
304 324 return
305 325 try:
306 326 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
307 327 # some process might change the requirement in between, re-read
308 328 # and update current_requirements
309 329 locked_requirements = localrepo._readrequires(hgvfs, True)
310 330 if locked_requirements != original_crequirements:
311 331 removed = current_requirements - locked_requirements
312 332 # update current_requirements in place because it's passed
313 333 # as reference
314 334 current_requirements -= removed
315 335 current_requirements |= locked_requirements
316 336 diffrequires = current_requirements - store_requirements
317 337 # add share-safe requirement as it will mark the share as share-safe
318 338 diffrequires.add(requirementsmod.SHARESAFE_REQUIREMENT)
319 339 current_requirements.add(requirementsmod.SHARESAFE_REQUIREMENT)
320 340 scmutil.writerequires(hgvfs, diffrequires)
321 341 ui.warn(_(b'repository upgraded to use share-safe mode\n'))
322 342 except error.LockError as e:
323 343 hint = _(
324 344 "see `hg help config.format.use-share-safe` for more information"
325 345 )
326 346 if mismatch_config == b'upgrade-abort':
327 347 raise error.Abort(
328 348 _(b'failed to upgrade share, got error: %s')
329 349 % stringutil.forcebytestr(e.strerror),
330 350 hint=hint,
331 351 )
332 352 elif mismatch_warn:
333 353 ui.warn(
334 354 _(b'failed to upgrade share, got error: %s\n')
335 355 % stringutil.forcebytestr(e.strerror),
336 356 hint=hint,
337 357 )
338 358 finally:
339 359 if wlock:
340 360 wlock.release()
341 361
342 362
343 363 def downgrade_share_to_non_safe(
344 364 ui,
345 365 hgvfs,
346 366 sharedvfs,
347 367 current_requirements,
348 368 mismatch_config,
349 369 mismatch_warn,
350 370 ):
351 371 """Downgrades a share which use share-safe to not use it"""
352 372 wlock = None
353 373 source_requirements = localrepo._readrequires(sharedvfs, True)
354 374 original_crequirements = current_requirements.copy()
355 375 # we cannot be 100% sure on which requirements were present in store when
356 376 # the source supported share-safe. However, we do know that working
357 377 # directory requirements were not there. Hence we remove them
358 378 source_requirements -= requirementsmod.WORKING_DIR_REQUIREMENTS
359 379 current_requirements |= source_requirements
360 380 current_requirements.remove(requirementsmod.SHARESAFE_REQUIREMENT)
361 381 if mismatch_config == b'allow':
362 382 return
363 383
364 384 try:
365 385 wlock = lockmod.trylock(ui, hgvfs, b'wlock', 0, 0)
366 386 # some process might change the requirement in between, re-read
367 387 # and update current_requirements
368 388 locked_requirements = localrepo._readrequires(hgvfs, True)
369 389 if locked_requirements != original_crequirements:
370 390 removed = current_requirements - locked_requirements
371 391 # update current_requirements in place because it's passed
372 392 # as reference
373 393 current_requirements -= removed
374 394 current_requirements |= locked_requirements
375 395 current_requirements |= source_requirements
376 396 current_requirements -= set(requirementsmod.SHARESAFE_REQUIREMENT)
377 397 scmutil.writerequires(hgvfs, current_requirements)
378 398 ui.warn(_(b'repository downgraded to not use share-safe mode\n'))
379 399 except error.LockError as e:
380 400 hint = _(
381 401 "see `hg help config.format.use-share-safe` for more information"
382 402 )
383 403 # If upgrade-abort is set, abort when upgrade fails, else let the
384 404 # process continue as `upgrade-allow` is set
385 405 if mismatch_config == b'downgrade-abort':
386 406 raise error.Abort(
387 407 _(b'failed to downgrade share, got error: %s')
388 408 % stringutil.forcebytestr(e.strerror),
389 409 hint=hint,
390 410 )
391 411 elif mismatch_warn:
392 412 ui.warn(
393 413 _(b'failed to downgrade share, got error: %s\n')
394 414 % stringutil.forcebytestr(e.strerror),
395 415 hint=hint,
396 416 )
397 417 finally:
398 418 if wlock:
399 419 wlock.release()
@@ -1,1782 +1,1804 b''
1 1 #require no-reposimplestore
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [extensions]
5 5 > share =
6 6 > [format]
7 7 > # stabilize test accross variant
8 8 > revlog-compression=zlib
9 9 > EOF
10 10
11 11 store and revlogv1 are required in source
12 12
13 13 $ hg --config format.usestore=false init no-store
14 14 $ hg -R no-store debugupgraderepo
15 15 abort: cannot upgrade repository; requirement missing: store
16 16 [255]
17 17
18 18 $ hg init no-revlogv1
19 19 $ cat > no-revlogv1/.hg/requires << EOF
20 20 > dotencode
21 21 > fncache
22 22 > generaldelta
23 23 > store
24 24 > EOF
25 25
26 26 $ hg -R no-revlogv1 debugupgraderepo
27 27 abort: cannot upgrade repository; missing a revlog version
28 28 [255]
29 29
30 30 Cannot upgrade shared repositories
31 31
32 32 $ hg init share-parent
33 33 $ hg -q share share-parent share-child
34 34
35 35 $ hg -R share-child debugupgraderepo
36 36 abort: cannot upgrade repository; unsupported source requirement: shared
37 37 [255]
38 38
39 39 Do not yet support upgrading treemanifest repos
40 40
41 41 $ hg --config experimental.treemanifest=true init treemanifest
42 42 $ hg -R treemanifest debugupgraderepo
43 43 abort: cannot upgrade repository; unsupported source requirement: treemanifest
44 44 [255]
45 45
46 46 Cannot add treemanifest requirement during upgrade
47 47
48 48 $ hg init disallowaddedreq
49 49 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
50 50 abort: cannot upgrade repository; do not support adding requirement: treemanifest
51 51 [255]
52 52
53 53 An upgrade of a repository created with recommended settings only suggests optimizations
54 54
55 55 $ hg init empty
56 56 $ cd empty
57 57 $ hg debugformat
58 58 format-variant repo
59 59 fncache: yes
60 60 dirstate-v2: no
61 61 dotencode: yes
62 62 generaldelta: yes
63 63 share-safe: no
64 64 sparserevlog: yes
65 65 persistent-nodemap: no (no-rust !)
66 66 persistent-nodemap: yes (rust !)
67 67 copies-sdc: no
68 68 revlog-v2: no
69 69 changelog-v2: no
70 70 plain-cl-delta: yes
71 71 compression: zlib
72 72 compression-level: default
73 73 $ hg debugformat --verbose
74 74 format-variant repo config default
75 75 fncache: yes yes yes
76 76 dirstate-v2: no no no
77 77 dotencode: yes yes yes
78 78 generaldelta: yes yes yes
79 79 share-safe: no no no
80 80 sparserevlog: yes yes yes
81 81 persistent-nodemap: no no no (no-rust !)
82 82 persistent-nodemap: yes yes no (rust !)
83 83 copies-sdc: no no no
84 84 revlog-v2: no no no
85 85 changelog-v2: no no no
86 86 plain-cl-delta: yes yes yes
87 87 compression: zlib zlib zlib (no-zstd !)
88 88 compression: zlib zlib zstd (zstd !)
89 89 compression-level: default default default
90 90 $ hg debugformat --verbose --config format.usefncache=no
91 91 format-variant repo config default
92 92 fncache: yes no yes
93 93 dirstate-v2: no no no
94 94 dotencode: yes no yes
95 95 generaldelta: yes yes yes
96 96 share-safe: no no no
97 97 sparserevlog: yes yes yes
98 98 persistent-nodemap: no no no (no-rust !)
99 99 persistent-nodemap: yes yes no (rust !)
100 100 copies-sdc: no no no
101 101 revlog-v2: no no no
102 102 changelog-v2: no no no
103 103 plain-cl-delta: yes yes yes
104 104 compression: zlib zlib zlib (no-zstd !)
105 105 compression: zlib zlib zstd (zstd !)
106 106 compression-level: default default default
107 107 $ hg debugformat --verbose --config format.usefncache=no --color=debug
108 108 format-variant repo config default
109 109 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
110 110 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
111 111 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
112 112 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
113 113 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
114 114 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
115 115 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
116 116 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
117 117 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
118 118 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
119 119 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
120 120 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
121 121 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
122 122 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
123 123 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
124 124 $ hg debugformat -Tjson
125 125 [
126 126 {
127 127 "config": true,
128 128 "default": true,
129 129 "name": "fncache",
130 130 "repo": true
131 131 },
132 132 {
133 133 "config": false,
134 134 "default": false,
135 135 "name": "dirstate-v2",
136 136 "repo": false
137 137 },
138 138 {
139 139 "config": true,
140 140 "default": true,
141 141 "name": "dotencode",
142 142 "repo": true
143 143 },
144 144 {
145 145 "config": true,
146 146 "default": true,
147 147 "name": "generaldelta",
148 148 "repo": true
149 149 },
150 150 {
151 151 "config": false,
152 152 "default": false,
153 153 "name": "share-safe",
154 154 "repo": false
155 155 },
156 156 {
157 157 "config": true,
158 158 "default": true,
159 159 "name": "sparserevlog",
160 160 "repo": true
161 161 },
162 162 {
163 163 "config": false, (no-rust !)
164 164 "config": true, (rust !)
165 165 "default": false,
166 166 "name": "persistent-nodemap",
167 167 "repo": false (no-rust !)
168 168 "repo": true (rust !)
169 169 },
170 170 {
171 171 "config": false,
172 172 "default": false,
173 173 "name": "copies-sdc",
174 174 "repo": false
175 175 },
176 176 {
177 177 "config": false,
178 178 "default": false,
179 179 "name": "revlog-v2",
180 180 "repo": false
181 181 },
182 182 {
183 183 "config": false,
184 184 "default": false,
185 185 "name": "changelog-v2",
186 186 "repo": false
187 187 },
188 188 {
189 189 "config": true,
190 190 "default": true,
191 191 "name": "plain-cl-delta",
192 192 "repo": true
193 193 },
194 194 {
195 195 "config": "zlib",
196 196 "default": "zlib", (no-zstd !)
197 197 "default": "zstd", (zstd !)
198 198 "name": "compression",
199 199 "repo": "zlib"
200 200 },
201 201 {
202 202 "config": "default",
203 203 "default": "default",
204 204 "name": "compression-level",
205 205 "repo": "default"
206 206 }
207 207 ]
208 208 $ hg debugupgraderepo
209 209 (no format upgrades found in existing repository)
210 210 performing an upgrade with "--run" will make the following changes:
211 211
212 212 requirements
213 213 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
214 214 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
215 215
216 216 processed revlogs:
217 217 - all-filelogs
218 218 - changelog
219 219 - manifest
220 220
221 221 additional optimizations are available by specifying "--optimize <name>":
222 222
223 223 re-delta-parent
224 224 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
225 225
226 226 re-delta-multibase
227 227 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
228 228
229 229 re-delta-all
230 230 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
231 231
232 232 re-delta-fulladd
233 233 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
234 234
235 235
236 236 $ hg debugupgraderepo --quiet
237 237 requirements
238 238 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
239 239 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
240 240
241 241 processed revlogs:
242 242 - all-filelogs
243 243 - changelog
244 244 - manifest
245 245
246 246
247 247 --optimize can be used to add optimizations
248 248
249 249 $ hg debugupgrade --optimize 're-delta-parent'
250 250 (no format upgrades found in existing repository)
251 251 performing an upgrade with "--run" will make the following changes:
252 252
253 253 requirements
254 254 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
255 255 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
256 256
257 257 optimisations: re-delta-parent
258 258
259 259 re-delta-parent
260 260 deltas within internal storage will choose a new base revision if needed
261 261
262 262 processed revlogs:
263 263 - all-filelogs
264 264 - changelog
265 265 - manifest
266 266
267 267 additional optimizations are available by specifying "--optimize <name>":
268 268
269 269 re-delta-multibase
270 270 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
271 271
272 272 re-delta-all
273 273 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
274 274
275 275 re-delta-fulladd
276 276 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
277 277
278 278
279 279 modern form of the option
280 280
281 281 $ hg debugupgrade --optimize re-delta-parent
282 282 (no format upgrades found in existing repository)
283 283 performing an upgrade with "--run" will make the following changes:
284 284
285 285 requirements
286 286 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
287 287 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
288 288
289 289 optimisations: re-delta-parent
290 290
291 291 re-delta-parent
292 292 deltas within internal storage will choose a new base revision if needed
293 293
294 294 processed revlogs:
295 295 - all-filelogs
296 296 - changelog
297 297 - manifest
298 298
299 299 additional optimizations are available by specifying "--optimize <name>":
300 300
301 301 re-delta-multibase
302 302 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
303 303
304 304 re-delta-all
305 305 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
306 306
307 307 re-delta-fulladd
308 308 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
309 309
310 310 $ hg debugupgrade --optimize re-delta-parent --quiet
311 311 requirements
312 312 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
313 313 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
314 314
315 315 optimisations: re-delta-parent
316 316
317 317 processed revlogs:
318 318 - all-filelogs
319 319 - changelog
320 320 - manifest
321 321
322 322
323 323 unknown optimization:
324 324
325 325 $ hg debugupgrade --optimize foobar
326 326 abort: unknown optimization action requested: foobar
327 327 (run without arguments to see valid optimizations)
328 328 [255]
329 329
330 330 Various sub-optimal detections work
331 331
332 332 $ cat > .hg/requires << EOF
333 333 > revlogv1
334 334 > store
335 335 > EOF
336 336
337 337 $ hg debugformat
338 338 format-variant repo
339 339 fncache: no
340 340 dirstate-v2: no
341 341 dotencode: no
342 342 generaldelta: no
343 343 share-safe: no
344 344 sparserevlog: no
345 345 persistent-nodemap: no
346 346 copies-sdc: no
347 347 revlog-v2: no
348 348 changelog-v2: no
349 349 plain-cl-delta: yes
350 350 compression: zlib
351 351 compression-level: default
352 352 $ hg debugformat --verbose
353 353 format-variant repo config default
354 354 fncache: no yes yes
355 355 dirstate-v2: no no no
356 356 dotencode: no yes yes
357 357 generaldelta: no yes yes
358 358 share-safe: no no no
359 359 sparserevlog: no yes yes
360 360 persistent-nodemap: no no no (no-rust !)
361 361 persistent-nodemap: no yes no (rust !)
362 362 copies-sdc: no no no
363 363 revlog-v2: no no no
364 364 changelog-v2: no no no
365 365 plain-cl-delta: yes yes yes
366 366 compression: zlib zlib zlib (no-zstd !)
367 367 compression: zlib zlib zstd (zstd !)
368 368 compression-level: default default default
369 369 $ hg debugformat --verbose --config format.usegeneraldelta=no
370 370 format-variant repo config default
371 371 fncache: no yes yes
372 372 dirstate-v2: no no no
373 373 dotencode: no yes yes
374 374 generaldelta: no no yes
375 375 share-safe: no no no
376 376 sparserevlog: no no yes
377 377 persistent-nodemap: no no no (no-rust !)
378 378 persistent-nodemap: no yes no (rust !)
379 379 copies-sdc: no no no
380 380 revlog-v2: no no no
381 381 changelog-v2: no no no
382 382 plain-cl-delta: yes yes yes
383 383 compression: zlib zlib zlib (no-zstd !)
384 384 compression: zlib zlib zstd (zstd !)
385 385 compression-level: default default default
386 386 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
387 387 format-variant repo config default
388 388 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
389 389 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
390 390 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
391 391 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
392 392 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
393 393 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
394 394 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
395 395 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
396 396 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
397 397 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
398 398 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
399 399 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
400 400 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
401 401 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
402 402 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
403 403 $ hg debugupgraderepo
404 note: selecting all-filelogs for processing to change: dotencode
405 note: selecting all-manifestlogs for processing to change: dotencode
406 note: selecting changelog for processing to change: dotencode
407
404 408 repository lacks features recommended by current config options:
405 409
406 410 fncache
407 411 long and reserved filenames may not work correctly; repository performance is sub-optimal
408 412
409 413 dotencode
410 414 storage of filenames beginning with a period or space may not work correctly
411 415
412 416 generaldelta
413 417 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
414 418
415 419 sparserevlog
416 420 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
417 421
418 422 persistent-nodemap (rust !)
419 423 persist the node -> rev mapping on disk to speedup lookup (rust !)
420 424 (rust !)
421 425
422 426 performing an upgrade with "--run" will make the following changes:
423 427
424 428 requirements
425 429 preserved: revlogv1, store
426 430 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
427 431 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
428 432
429 433 fncache
430 434 repository will be more resilient to storing certain paths and performance of certain operations should be improved
431 435
432 436 dotencode
433 437 repository will be better able to store files beginning with a space or period
434 438
435 439 generaldelta
436 440 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
437 441
438 442 sparserevlog
439 443 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
440 444
441 445 persistent-nodemap (rust !)
442 446 Speedup revision lookup by node id. (rust !)
443 447 (rust !)
444 448 processed revlogs:
445 449 - all-filelogs
446 450 - changelog
447 451 - manifest
448 452
449 453 additional optimizations are available by specifying "--optimize <name>":
450 454
451 455 re-delta-parent
452 456 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
453 457
454 458 re-delta-multibase
455 459 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
456 460
457 461 re-delta-all
458 462 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
459 463
460 464 re-delta-fulladd
461 465 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
462 466
463 467 $ hg debugupgraderepo --quiet
464 468 requirements
465 469 preserved: revlogv1, store
466 470 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
467 471 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
468 472
469 473 processed revlogs:
470 474 - all-filelogs
471 475 - changelog
472 476 - manifest
473 477
474 478
475 479 $ hg --config format.dotencode=false debugupgraderepo
480 note: selecting all-filelogs for processing to change: fncache
481 note: selecting all-manifestlogs for processing to change: fncache
482 note: selecting changelog for processing to change: fncache
483
476 484 repository lacks features recommended by current config options:
477 485
478 486 fncache
479 487 long and reserved filenames may not work correctly; repository performance is sub-optimal
480 488
481 489 generaldelta
482 490 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
483 491
484 492 sparserevlog
485 493 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
486 494
487 495 persistent-nodemap (rust !)
488 496 persist the node -> rev mapping on disk to speedup lookup (rust !)
489 497 (rust !)
490 498 repository lacks features used by the default config options:
491 499
492 500 dotencode
493 501 storage of filenames beginning with a period or space may not work correctly
494 502
495 503
496 504 performing an upgrade with "--run" will make the following changes:
497 505
498 506 requirements
499 507 preserved: revlogv1, store
500 508 added: fncache, generaldelta, sparserevlog (no-rust !)
501 509 added: fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
502 510
503 511 fncache
504 512 repository will be more resilient to storing certain paths and performance of certain operations should be improved
505 513
506 514 generaldelta
507 515 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
508 516
509 517 sparserevlog
510 518 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
511 519
512 520 persistent-nodemap (rust !)
513 521 Speedup revision lookup by node id. (rust !)
514 522 (rust !)
515 523 processed revlogs:
516 524 - all-filelogs
517 525 - changelog
518 526 - manifest
519 527
520 528 additional optimizations are available by specifying "--optimize <name>":
521 529
522 530 re-delta-parent
523 531 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
524 532
525 533 re-delta-multibase
526 534 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
527 535
528 536 re-delta-all
529 537 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
530 538
531 539 re-delta-fulladd
532 540 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
533 541
534 542
535 543 $ cd ..
536 544
537 545 Upgrading a repository that is already modern essentially no-ops
538 546
539 547 $ hg init modern
540 548 $ hg -R modern debugupgraderepo --run
541 549 nothing to do
542 550
543 551 Upgrading a repository to generaldelta works
544 552
545 553 $ hg --config format.usegeneraldelta=false init upgradegd
546 554 $ cd upgradegd
547 555 $ touch f0
548 556 $ hg -q commit -A -m initial
549 557 $ mkdir FooBarDirectory.d
550 558 $ touch FooBarDirectory.d/f1
551 559 $ hg -q commit -A -m 'add f1'
552 560 $ hg -q up -r 0
553 561 >>> from __future__ import absolute_import, print_function
554 562 >>> import random
555 563 >>> random.seed(0) # have a reproducible content
556 564 >>> with open("f2", "wb") as f:
557 565 ... for i in range(100000):
558 566 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
559 567 $ hg -q commit -A -m 'add f2'
560 568
561 569 make sure we have a .d file
562 570
563 571 $ ls -d .hg/store/data/*
564 572 .hg/store/data/_foo_bar_directory.d.hg
565 573 .hg/store/data/f0.i
566 574 .hg/store/data/f2.d
567 575 .hg/store/data/f2.i
568 576
569 577 $ hg debugupgraderepo --run --config format.sparse-revlog=false
578 note: selecting all-filelogs for processing to change: generaldelta
579 note: selecting all-manifestlogs for processing to change: generaldelta
580 note: selecting changelog for processing to change: generaldelta
581
570 582 upgrade will perform the following actions:
571 583
572 584 requirements
573 585 preserved: dotencode, fncache, revlogv1, store (no-rust !)
574 586 preserved: dotencode, fncache, persistent-nodemap, revlogv1, store (rust !)
575 587 added: generaldelta
576 588
577 589 generaldelta
578 590 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
579 591
580 592 processed revlogs:
581 593 - all-filelogs
582 594 - changelog
583 595 - manifest
584 596
585 597 beginning upgrade...
586 598 repository locked and read-only
587 599 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
588 600 (it is safe to interrupt this process any time before data migration completes)
589 601 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
590 602 migrating 519 KB in store; 1.05 MB tracked data
591 603 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
592 604 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
593 605 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
594 606 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
595 607 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
596 608 finished migrating 3 changelog revisions; change in size: 0 bytes
597 609 finished migrating 9 total revisions; total change in store size: -17 bytes
598 610 copying phaseroots
599 611 data fully upgraded in a temporary repository
600 612 marking source repository as being upgraded; clients will be unable to read from repository
601 613 starting in-place swap of repository data
602 614 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
603 615 replacing store...
604 616 store replacement complete; repository was inconsistent for *s (glob)
605 617 finalizing requirements file and making repository readable again
606 618 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
607 619 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
608 620 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
609 621
610 622 Original requirements backed up
611 623
612 624 $ cat .hg/upgradebackup.*/requires
613 625 dotencode
614 626 fncache
615 627 persistent-nodemap (rust !)
616 628 revlogv1
617 629 store
618 630
619 631 generaldelta added to original requirements files
620 632
621 633 $ cat .hg/requires
622 634 dotencode
623 635 fncache
624 636 generaldelta
625 637 persistent-nodemap (rust !)
626 638 revlogv1
627 639 store
628 640
629 641 store directory has files we expect
630 642
631 643 $ ls .hg/store
632 644 00changelog.i
633 645 00manifest.i
634 646 data
635 647 fncache
636 648 phaseroots
637 649 undo
638 650 undo.backupfiles
639 651 undo.phaseroots
640 652
641 653 manifest should be generaldelta
642 654
643 655 $ hg debugrevlog -m | grep flags
644 656 flags : inline, generaldelta
645 657
646 658 verify should be happy
647 659
648 660 $ hg verify
649 661 checking changesets
650 662 checking manifests
651 663 crosschecking files in changesets and manifests
652 664 checking files
653 665 checked 3 changesets with 3 changes to 3 files
654 666
655 667 old store should be backed up
656 668
657 669 $ ls -d .hg/upgradebackup.*/
658 670 .hg/upgradebackup.*/ (glob)
659 671 $ ls .hg/upgradebackup.*/store
660 672 00changelog.i
661 673 00manifest.i
662 674 data
663 675 fncache
664 676 phaseroots
665 677 undo
666 678 undo.backup.fncache
667 679 undo.backupfiles
668 680 undo.phaseroots
669 681
670 682 unless --no-backup is passed
671 683
672 684 $ rm -rf .hg/upgradebackup.*/
673 685 $ hg debugupgraderepo --run --no-backup
686 note: selecting all-filelogs for processing to change: sparserevlog
687 note: selecting all-manifestlogs for processing to change: sparserevlog
688 note: selecting changelog for processing to change: sparserevlog
689
674 690 upgrade will perform the following actions:
675 691
676 692 requirements
677 693 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
678 694 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
679 695 added: sparserevlog
680 696
681 697 sparserevlog
682 698 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
683 699
684 700 processed revlogs:
685 701 - all-filelogs
686 702 - changelog
687 703 - manifest
688 704
689 705 beginning upgrade...
690 706 repository locked and read-only
691 707 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
692 708 (it is safe to interrupt this process any time before data migration completes)
693 709 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
694 710 migrating 519 KB in store; 1.05 MB tracked data
695 711 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
696 712 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
697 713 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
698 714 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
699 715 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
700 716 finished migrating 3 changelog revisions; change in size: 0 bytes
701 717 finished migrating 9 total revisions; total change in store size: 0 bytes
702 718 copying phaseroots
703 719 data fully upgraded in a temporary repository
704 720 marking source repository as being upgraded; clients will be unable to read from repository
705 721 starting in-place swap of repository data
706 722 replacing store...
707 723 store replacement complete; repository was inconsistent for * (glob)
708 724 finalizing requirements file and making repository readable again
709 725 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
710 726 $ ls -1 .hg/ | grep upgradebackup
711 727 [1]
712 728
713 729 We can restrict optimization to some revlog:
714 730
715 731 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
716 732 upgrade will perform the following actions:
717 733
718 734 requirements
719 735 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
720 736 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
721 737
722 738 optimisations: re-delta-parent
723 739
724 740 re-delta-parent
725 741 deltas within internal storage will choose a new base revision if needed
726 742
727 743 processed revlogs:
728 744 - manifest
729 745
730 746 beginning upgrade...
731 747 repository locked and read-only
732 748 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
733 749 (it is safe to interrupt this process any time before data migration completes)
734 750 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
735 751 migrating 519 KB in store; 1.05 MB tracked data
736 752 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
737 753 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
738 754 blindly copying data/f0.i containing 1 revisions
739 755 blindly copying data/f2.i containing 1 revisions
740 756 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
741 757 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
742 758 cloning 3 revisions from 00manifest.i
743 759 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
744 760 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
745 761 blindly copying 00changelog.i containing 3 revisions
746 762 finished migrating 3 changelog revisions; change in size: 0 bytes
747 763 finished migrating 9 total revisions; total change in store size: 0 bytes
748 764 copying phaseroots
749 765 data fully upgraded in a temporary repository
750 766 marking source repository as being upgraded; clients will be unable to read from repository
751 767 starting in-place swap of repository data
752 768 replacing store...
753 769 store replacement complete; repository was inconsistent for *s (glob)
754 770 finalizing requirements file and making repository readable again
755 771 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
756 772
757 773 Check that the repo still works fine
758 774
759 775 $ hg log -G --stat
760 776 @ changeset: 2:76d4395f5413 (no-py3 !)
761 777 @ changeset: 2:fca376863211 (py3 !)
762 778 | tag: tip
763 779 | parent: 0:ba592bf28da2
764 780 | user: test
765 781 | date: Thu Jan 01 00:00:00 1970 +0000
766 782 | summary: add f2
767 783 |
768 784 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
769 785 | 1 files changed, 100000 insertions(+), 0 deletions(-)
770 786 |
771 787 | o changeset: 1:2029ce2354e2
772 788 |/ user: test
773 789 | date: Thu Jan 01 00:00:00 1970 +0000
774 790 | summary: add f1
775 791 |
776 792 |
777 793 o changeset: 0:ba592bf28da2
778 794 user: test
779 795 date: Thu Jan 01 00:00:00 1970 +0000
780 796 summary: initial
781 797
782 798
783 799
784 800 $ hg verify
785 801 checking changesets
786 802 checking manifests
787 803 crosschecking files in changesets and manifests
788 804 checking files
789 805 checked 3 changesets with 3 changes to 3 files
790 806
791 807 Check we can select negatively
792 808
793 809 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
794 810 upgrade will perform the following actions:
795 811
796 812 requirements
797 813 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
798 814 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
799 815
800 816 optimisations: re-delta-parent
801 817
802 818 re-delta-parent
803 819 deltas within internal storage will choose a new base revision if needed
804 820
805 821 processed revlogs:
806 822 - all-filelogs
807 823 - changelog
808 824
809 825 beginning upgrade...
810 826 repository locked and read-only
811 827 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
812 828 (it is safe to interrupt this process any time before data migration completes)
813 829 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
814 830 migrating 519 KB in store; 1.05 MB tracked data
815 831 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
816 832 cloning 1 revisions from data/FooBarDirectory.d/f1.i
817 833 cloning 1 revisions from data/f0.i
818 834 cloning 1 revisions from data/f2.i
819 835 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
820 836 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
821 837 blindly copying 00manifest.i containing 3 revisions
822 838 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
823 839 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
824 840 cloning 3 revisions from 00changelog.i
825 841 finished migrating 3 changelog revisions; change in size: 0 bytes
826 842 finished migrating 9 total revisions; total change in store size: 0 bytes
827 843 copying phaseroots
828 844 data fully upgraded in a temporary repository
829 845 marking source repository as being upgraded; clients will be unable to read from repository
830 846 starting in-place swap of repository data
831 847 replacing store...
832 848 store replacement complete; repository was inconsistent for *s (glob)
833 849 finalizing requirements file and making repository readable again
834 850 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
835 851 $ hg verify
836 852 checking changesets
837 853 checking manifests
838 854 crosschecking files in changesets and manifests
839 855 checking files
840 856 checked 3 changesets with 3 changes to 3 files
841 857
842 858 Check that we can select changelog only
843 859
844 860 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
845 861 upgrade will perform the following actions:
846 862
847 863 requirements
848 864 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
849 865 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
850 866
851 867 optimisations: re-delta-parent
852 868
853 869 re-delta-parent
854 870 deltas within internal storage will choose a new base revision if needed
855 871
856 872 processed revlogs:
857 873 - changelog
858 874
859 875 beginning upgrade...
860 876 repository locked and read-only
861 877 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
862 878 (it is safe to interrupt this process any time before data migration completes)
863 879 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
864 880 migrating 519 KB in store; 1.05 MB tracked data
865 881 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
866 882 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
867 883 blindly copying data/f0.i containing 1 revisions
868 884 blindly copying data/f2.i containing 1 revisions
869 885 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
870 886 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
871 887 blindly copying 00manifest.i containing 3 revisions
872 888 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
873 889 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
874 890 cloning 3 revisions from 00changelog.i
875 891 finished migrating 3 changelog revisions; change in size: 0 bytes
876 892 finished migrating 9 total revisions; total change in store size: 0 bytes
877 893 copying phaseroots
878 894 data fully upgraded in a temporary repository
879 895 marking source repository as being upgraded; clients will be unable to read from repository
880 896 starting in-place swap of repository data
881 897 replacing store...
882 898 store replacement complete; repository was inconsistent for *s (glob)
883 899 finalizing requirements file and making repository readable again
884 900 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
885 901 $ hg verify
886 902 checking changesets
887 903 checking manifests
888 904 crosschecking files in changesets and manifests
889 905 checking files
890 906 checked 3 changesets with 3 changes to 3 files
891 907
892 908 Check that we can select filelog only
893 909
894 910 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
895 911 upgrade will perform the following actions:
896 912
897 913 requirements
898 914 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
899 915 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
900 916
901 917 optimisations: re-delta-parent
902 918
903 919 re-delta-parent
904 920 deltas within internal storage will choose a new base revision if needed
905 921
906 922 processed revlogs:
907 923 - all-filelogs
908 924
909 925 beginning upgrade...
910 926 repository locked and read-only
911 927 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
912 928 (it is safe to interrupt this process any time before data migration completes)
913 929 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
914 930 migrating 519 KB in store; 1.05 MB tracked data
915 931 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
916 932 cloning 1 revisions from data/FooBarDirectory.d/f1.i
917 933 cloning 1 revisions from data/f0.i
918 934 cloning 1 revisions from data/f2.i
919 935 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
920 936 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
921 937 blindly copying 00manifest.i containing 3 revisions
922 938 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
923 939 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
924 940 blindly copying 00changelog.i containing 3 revisions
925 941 finished migrating 3 changelog revisions; change in size: 0 bytes
926 942 finished migrating 9 total revisions; total change in store size: 0 bytes
927 943 copying phaseroots
928 944 data fully upgraded in a temporary repository
929 945 marking source repository as being upgraded; clients will be unable to read from repository
930 946 starting in-place swap of repository data
931 947 replacing store...
932 948 store replacement complete; repository was inconsistent for *s (glob)
933 949 finalizing requirements file and making repository readable again
934 950 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
935 951 $ hg verify
936 952 checking changesets
937 953 checking manifests
938 954 crosschecking files in changesets and manifests
939 955 checking files
940 956 checked 3 changesets with 3 changes to 3 files
941 957
942 958
943 959 Check you can't skip revlog clone during important format downgrade
944 960
945 961 $ echo "[format]" > .hg/hgrc
946 962 $ echo "sparse-revlog=no" >> .hg/hgrc
947 963 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
948 964 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
949 965
950 966 ignoring revlogs selection flags, format requirements change: sparserevlog
951 967 requirements
952 968 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
953 969 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
954 970 removed: sparserevlog
955 971
956 972 optimisations: re-delta-parent
957 973
958 974 processed revlogs:
959 975 - all-filelogs
960 976 - changelog
961 977 - manifest
962 978
963 979 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
980 note: selecting all-filelogs for processing to change: sparserevlog
981 note: selecting changelog for processing to change: sparserevlog
982
964 983 ignoring revlogs selection flags, format requirements change: sparserevlog
965 984 upgrade will perform the following actions:
966 985
967 986 requirements
968 987 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
969 988 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
970 989 removed: sparserevlog
971 990
972 991 optimisations: re-delta-parent
973 992
974 993 re-delta-parent
975 994 deltas within internal storage will choose a new base revision if needed
976 995
977 996 processed revlogs:
978 997 - all-filelogs
979 998 - changelog
980 999 - manifest
981 1000
982 1001 beginning upgrade...
983 1002 repository locked and read-only
984 1003 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
985 1004 (it is safe to interrupt this process any time before data migration completes)
986 1005 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
987 1006 migrating 519 KB in store; 1.05 MB tracked data
988 1007 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
989 1008 cloning 1 revisions from data/FooBarDirectory.d/f1.i
990 1009 cloning 1 revisions from data/f0.i
991 1010 cloning 1 revisions from data/f2.i
992 1011 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
993 1012 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
994 1013 cloning 3 revisions from 00manifest.i
995 1014 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
996 1015 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
997 1016 cloning 3 revisions from 00changelog.i
998 1017 finished migrating 3 changelog revisions; change in size: 0 bytes
999 1018 finished migrating 9 total revisions; total change in store size: 0 bytes
1000 1019 copying phaseroots
1001 1020 data fully upgraded in a temporary repository
1002 1021 marking source repository as being upgraded; clients will be unable to read from repository
1003 1022 starting in-place swap of repository data
1004 1023 replacing store...
1005 1024 store replacement complete; repository was inconsistent for *s (glob)
1006 1025 finalizing requirements file and making repository readable again
1007 1026 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1008 1027 $ hg verify
1009 1028 checking changesets
1010 1029 checking manifests
1011 1030 crosschecking files in changesets and manifests
1012 1031 checking files
1013 1032 checked 3 changesets with 3 changes to 3 files
1014 1033
1015 1034 Check you can't skip revlog clone during important format upgrade
1016 1035
1017 1036 $ echo "sparse-revlog=yes" >> .hg/hgrc
1018 1037 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1038 note: selecting all-filelogs for processing to change: sparserevlog
1039 note: selecting changelog for processing to change: sparserevlog
1040
1019 1041 ignoring revlogs selection flags, format requirements change: sparserevlog
1020 1042 upgrade will perform the following actions:
1021 1043
1022 1044 requirements
1023 1045 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1024 1046 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1025 1047 added: sparserevlog
1026 1048
1027 1049 optimisations: re-delta-parent
1028 1050
1029 1051 sparserevlog
1030 1052 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1031 1053
1032 1054 re-delta-parent
1033 1055 deltas within internal storage will choose a new base revision if needed
1034 1056
1035 1057 processed revlogs:
1036 1058 - all-filelogs
1037 1059 - changelog
1038 1060 - manifest
1039 1061
1040 1062 beginning upgrade...
1041 1063 repository locked and read-only
1042 1064 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1043 1065 (it is safe to interrupt this process any time before data migration completes)
1044 1066 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1045 1067 migrating 519 KB in store; 1.05 MB tracked data
1046 1068 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1047 1069 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1048 1070 cloning 1 revisions from data/f0.i
1049 1071 cloning 1 revisions from data/f2.i
1050 1072 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1051 1073 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1052 1074 cloning 3 revisions from 00manifest.i
1053 1075 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1054 1076 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1055 1077 cloning 3 revisions from 00changelog.i
1056 1078 finished migrating 3 changelog revisions; change in size: 0 bytes
1057 1079 finished migrating 9 total revisions; total change in store size: 0 bytes
1058 1080 copying phaseroots
1059 1081 data fully upgraded in a temporary repository
1060 1082 marking source repository as being upgraded; clients will be unable to read from repository
1061 1083 starting in-place swap of repository data
1062 1084 replacing store...
1063 1085 store replacement complete; repository was inconsistent for *s (glob)
1064 1086 finalizing requirements file and making repository readable again
1065 1087 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1066 1088 $ hg verify
1067 1089 checking changesets
1068 1090 checking manifests
1069 1091 crosschecking files in changesets and manifests
1070 1092 checking files
1071 1093 checked 3 changesets with 3 changes to 3 files
1072 1094
1073 1095 $ cd ..
1074 1096
1075 1097 store files with special filenames aren't encoded during copy
1076 1098
1077 1099 $ hg init store-filenames
1078 1100 $ cd store-filenames
1079 1101 $ touch foo
1080 1102 $ hg -q commit -A -m initial
1081 1103 $ touch .hg/store/.XX_special_filename
1082 1104
1083 1105 $ hg debugupgraderepo --run
1084 1106 nothing to do
1085 1107 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1086 1108 upgrade will perform the following actions:
1087 1109
1088 1110 requirements
1089 1111 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1090 1112 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1091 1113
1092 1114 optimisations: re-delta-fulladd
1093 1115
1094 1116 re-delta-fulladd
1095 1117 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1096 1118
1097 1119 processed revlogs:
1098 1120 - all-filelogs
1099 1121 - changelog
1100 1122 - manifest
1101 1123
1102 1124 beginning upgrade...
1103 1125 repository locked and read-only
1104 1126 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1105 1127 (it is safe to interrupt this process any time before data migration completes)
1106 1128 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1107 1129 migrating 301 bytes in store; 107 bytes tracked data
1108 1130 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1109 1131 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1110 1132 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1111 1133 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1112 1134 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1113 1135 finished migrating 1 changelog revisions; change in size: 0 bytes
1114 1136 finished migrating 3 total revisions; total change in store size: 0 bytes
1115 1137 copying .XX_special_filename
1116 1138 copying phaseroots
1117 1139 data fully upgraded in a temporary repository
1118 1140 marking source repository as being upgraded; clients will be unable to read from repository
1119 1141 starting in-place swap of repository data
1120 1142 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1121 1143 replacing store...
1122 1144 store replacement complete; repository was inconsistent for *s (glob)
1123 1145 finalizing requirements file and making repository readable again
1124 1146 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1125 1147 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1126 1148 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1127 1149
1128 1150 fncache is valid after upgrade
1129 1151
1130 1152 $ hg debugrebuildfncache
1131 1153 fncache already up to date
1132 1154
1133 1155 $ cd ..
1134 1156
1135 1157 Check upgrading a large file repository
1136 1158 ---------------------------------------
1137 1159
1138 1160 $ hg init largefilesrepo
1139 1161 $ cat << EOF >> largefilesrepo/.hg/hgrc
1140 1162 > [extensions]
1141 1163 > largefiles =
1142 1164 > EOF
1143 1165
1144 1166 $ cd largefilesrepo
1145 1167 $ touch foo
1146 1168 $ hg add --large foo
1147 1169 $ hg -q commit -m initial
1148 1170 $ cat .hg/requires
1149 1171 dotencode
1150 1172 fncache
1151 1173 generaldelta
1152 1174 largefiles
1153 1175 persistent-nodemap (rust !)
1154 1176 revlogv1
1155 1177 sparserevlog
1156 1178 store
1157 1179
1158 1180 $ hg debugupgraderepo --run
1159 1181 nothing to do
1160 1182 $ cat .hg/requires
1161 1183 dotencode
1162 1184 fncache
1163 1185 generaldelta
1164 1186 largefiles
1165 1187 persistent-nodemap (rust !)
1166 1188 revlogv1
1167 1189 sparserevlog
1168 1190 store
1169 1191
1170 1192 $ cat << EOF >> .hg/hgrc
1171 1193 > [extensions]
1172 1194 > lfs =
1173 1195 > [lfs]
1174 1196 > threshold = 10
1175 1197 > EOF
1176 1198 $ echo '123456789012345' > lfs.bin
1177 1199 $ hg ci -Am 'lfs.bin'
1178 1200 adding lfs.bin
1179 1201 $ grep lfs .hg/requires
1180 1202 lfs
1181 1203 $ find .hg/store/lfs -type f
1182 1204 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1183 1205
1184 1206 $ hg debugupgraderepo --run
1185 1207 nothing to do
1186 1208
1187 1209 $ grep lfs .hg/requires
1188 1210 lfs
1189 1211 $ find .hg/store/lfs -type f
1190 1212 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1191 1213 $ hg verify
1192 1214 checking changesets
1193 1215 checking manifests
1194 1216 crosschecking files in changesets and manifests
1195 1217 checking files
1196 1218 checked 2 changesets with 2 changes to 2 files
1197 1219 $ hg debugdata lfs.bin 0
1198 1220 version https://git-lfs.github.com/spec/v1
1199 1221 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1200 1222 size 16
1201 1223 x-is-binary 0
1202 1224
1203 1225 $ cd ..
1204 1226
1205 1227 repository config is taken in account
1206 1228 -------------------------------------
1207 1229
1208 1230 $ cat << EOF >> $HGRCPATH
1209 1231 > [format]
1210 1232 > maxchainlen = 1
1211 1233 > EOF
1212 1234
1213 1235 $ hg init localconfig
1214 1236 $ cd localconfig
1215 1237 $ cat << EOF > file
1216 1238 > some content
1217 1239 > with some length
1218 1240 > to make sure we get a delta
1219 1241 > after changes
1220 1242 > very long
1221 1243 > very long
1222 1244 > very long
1223 1245 > very long
1224 1246 > very long
1225 1247 > very long
1226 1248 > very long
1227 1249 > very long
1228 1250 > very long
1229 1251 > very long
1230 1252 > very long
1231 1253 > EOF
1232 1254 $ hg -q commit -A -m A
1233 1255 $ echo "new line" >> file
1234 1256 $ hg -q commit -m B
1235 1257 $ echo "new line" >> file
1236 1258 $ hg -q commit -m C
1237 1259
1238 1260 $ cat << EOF >> .hg/hgrc
1239 1261 > [format]
1240 1262 > maxchainlen = 9001
1241 1263 > EOF
1242 1264 $ hg config format
1243 1265 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1244 1266 format.maxchainlen=9001
1245 1267 $ hg debugdeltachain file
1246 1268 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1247 1269 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1248 1270 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1249 1271 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1250 1272
1251 1273 $ hg debugupgraderepo --run --optimize 're-delta-all'
1252 1274 upgrade will perform the following actions:
1253 1275
1254 1276 requirements
1255 1277 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1256 1278 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1257 1279
1258 1280 optimisations: re-delta-all
1259 1281
1260 1282 re-delta-all
1261 1283 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1262 1284
1263 1285 processed revlogs:
1264 1286 - all-filelogs
1265 1287 - changelog
1266 1288 - manifest
1267 1289
1268 1290 beginning upgrade...
1269 1291 repository locked and read-only
1270 1292 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1271 1293 (it is safe to interrupt this process any time before data migration completes)
1272 1294 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1273 1295 migrating 1019 bytes in store; 882 bytes tracked data
1274 1296 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1275 1297 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1276 1298 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1277 1299 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1278 1300 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1279 1301 finished migrating 3 changelog revisions; change in size: 0 bytes
1280 1302 finished migrating 9 total revisions; total change in store size: -9 bytes
1281 1303 copying phaseroots
1282 1304 data fully upgraded in a temporary repository
1283 1305 marking source repository as being upgraded; clients will be unable to read from repository
1284 1306 starting in-place swap of repository data
1285 1307 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1286 1308 replacing store...
1287 1309 store replacement complete; repository was inconsistent for *s (glob)
1288 1310 finalizing requirements file and making repository readable again
1289 1311 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1290 1312 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1291 1313 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1292 1314 $ hg debugdeltachain file
1293 1315 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1294 1316 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1295 1317 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1296 1318 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1297 1319 $ cd ..
1298 1320
1299 1321 $ cat << EOF >> $HGRCPATH
1300 1322 > [format]
1301 1323 > maxchainlen = 9001
1302 1324 > EOF
1303 1325
1304 1326 Check upgrading a sparse-revlog repository
1305 1327 ---------------------------------------
1306 1328
1307 1329 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1308 1330 $ cd sparserevlogrepo
1309 1331 $ touch foo
1310 1332 $ hg add foo
1311 1333 $ hg -q commit -m "foo"
1312 1334 $ cat .hg/requires
1313 1335 dotencode
1314 1336 fncache
1315 1337 generaldelta
1316 1338 persistent-nodemap (rust !)
1317 1339 revlogv1
1318 1340 store
1319 1341
1320 1342 Check that we can add the sparse-revlog format requirement
1321 1343 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1322 1344 upgrade will perform the following actions:
1323 1345
1324 1346 requirements
1325 1347 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1326 1348 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1327 1349 added: sparserevlog
1328 1350
1329 1351 processed revlogs:
1330 1352 - all-filelogs
1331 1353 - changelog
1332 1354 - manifest
1333 1355
1334 1356 $ cat .hg/requires
1335 1357 dotencode
1336 1358 fncache
1337 1359 generaldelta
1338 1360 persistent-nodemap (rust !)
1339 1361 revlogv1
1340 1362 sparserevlog
1341 1363 store
1342 1364
1343 1365 Check that we can remove the sparse-revlog format requirement
1344 1366 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1345 1367 upgrade will perform the following actions:
1346 1368
1347 1369 requirements
1348 1370 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1349 1371 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1350 1372 removed: sparserevlog
1351 1373
1352 1374 processed revlogs:
1353 1375 - all-filelogs
1354 1376 - changelog
1355 1377 - manifest
1356 1378
1357 1379 $ cat .hg/requires
1358 1380 dotencode
1359 1381 fncache
1360 1382 generaldelta
1361 1383 persistent-nodemap (rust !)
1362 1384 revlogv1
1363 1385 store
1364 1386
1365 1387 #if zstd
1366 1388
1367 1389 Check upgrading to a zstd revlog
1368 1390 --------------------------------
1369 1391
1370 1392 upgrade
1371 1393
1372 1394 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1373 1395 upgrade will perform the following actions:
1374 1396
1375 1397 requirements
1376 1398 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1377 1399 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1378 1400 added: revlog-compression-zstd, sparserevlog
1379 1401
1380 1402 processed revlogs:
1381 1403 - all-filelogs
1382 1404 - changelog
1383 1405 - manifest
1384 1406
1385 1407 $ hg debugformat -v
1386 1408 format-variant repo config default
1387 1409 fncache: yes yes yes
1388 1410 dirstate-v2: no no no
1389 1411 dotencode: yes yes yes
1390 1412 generaldelta: yes yes yes
1391 1413 share-safe: no no no
1392 1414 sparserevlog: yes yes yes
1393 1415 persistent-nodemap: no no no (no-rust !)
1394 1416 persistent-nodemap: yes yes no (rust !)
1395 1417 copies-sdc: no no no
1396 1418 revlog-v2: no no no
1397 1419 changelog-v2: no no no
1398 1420 plain-cl-delta: yes yes yes
1399 1421 compression: zlib zlib zlib (no-zstd !)
1400 1422 compression: zstd zlib zstd (zstd !)
1401 1423 compression-level: default default default
1402 1424 $ cat .hg/requires
1403 1425 dotencode
1404 1426 fncache
1405 1427 generaldelta
1406 1428 persistent-nodemap (rust !)
1407 1429 revlog-compression-zstd
1408 1430 revlogv1
1409 1431 sparserevlog
1410 1432 store
1411 1433
1412 1434 downgrade
1413 1435
1414 1436 $ hg debugupgraderepo --run --no-backup --quiet
1415 1437 upgrade will perform the following actions:
1416 1438
1417 1439 requirements
1418 1440 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1419 1441 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1420 1442 removed: revlog-compression-zstd
1421 1443
1422 1444 processed revlogs:
1423 1445 - all-filelogs
1424 1446 - changelog
1425 1447 - manifest
1426 1448
1427 1449 $ hg debugformat -v
1428 1450 format-variant repo config default
1429 1451 fncache: yes yes yes
1430 1452 dirstate-v2: no no no
1431 1453 dotencode: yes yes yes
1432 1454 generaldelta: yes yes yes
1433 1455 share-safe: no no no
1434 1456 sparserevlog: yes yes yes
1435 1457 persistent-nodemap: no no no (no-rust !)
1436 1458 persistent-nodemap: yes yes no (rust !)
1437 1459 copies-sdc: no no no
1438 1460 revlog-v2: no no no
1439 1461 changelog-v2: no no no
1440 1462 plain-cl-delta: yes yes yes
1441 1463 compression: zlib zlib zlib (no-zstd !)
1442 1464 compression: zlib zlib zstd (zstd !)
1443 1465 compression-level: default default default
1444 1466 $ cat .hg/requires
1445 1467 dotencode
1446 1468 fncache
1447 1469 generaldelta
1448 1470 persistent-nodemap (rust !)
1449 1471 revlogv1
1450 1472 sparserevlog
1451 1473 store
1452 1474
1453 1475 upgrade from hgrc
1454 1476
1455 1477 $ cat >> .hg/hgrc << EOF
1456 1478 > [format]
1457 1479 > revlog-compression=zstd
1458 1480 > EOF
1459 1481 $ hg debugupgraderepo --run --no-backup --quiet
1460 1482 upgrade will perform the following actions:
1461 1483
1462 1484 requirements
1463 1485 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1464 1486 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1465 1487 added: revlog-compression-zstd
1466 1488
1467 1489 processed revlogs:
1468 1490 - all-filelogs
1469 1491 - changelog
1470 1492 - manifest
1471 1493
1472 1494 $ hg debugformat -v
1473 1495 format-variant repo config default
1474 1496 fncache: yes yes yes
1475 1497 dirstate-v2: no no no
1476 1498 dotencode: yes yes yes
1477 1499 generaldelta: yes yes yes
1478 1500 share-safe: no no no
1479 1501 sparserevlog: yes yes yes
1480 1502 persistent-nodemap: no no no (no-rust !)
1481 1503 persistent-nodemap: yes yes no (rust !)
1482 1504 copies-sdc: no no no
1483 1505 revlog-v2: no no no
1484 1506 changelog-v2: no no no
1485 1507 plain-cl-delta: yes yes yes
1486 1508 compression: zlib zlib zlib (no-zstd !)
1487 1509 compression: zstd zstd zstd (zstd !)
1488 1510 compression-level: default default default
1489 1511 $ cat .hg/requires
1490 1512 dotencode
1491 1513 fncache
1492 1514 generaldelta
1493 1515 persistent-nodemap (rust !)
1494 1516 revlog-compression-zstd
1495 1517 revlogv1
1496 1518 sparserevlog
1497 1519 store
1498 1520
1499 1521 #endif
1500 1522
1501 1523 Check upgrading to a revlog format supporting sidedata
1502 1524 ------------------------------------------------------
1503 1525
1504 1526 upgrade
1505 1527
1506 1528 $ hg debugsidedata -c 0
1507 1529 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1508 1530 upgrade will perform the following actions:
1509 1531
1510 1532 requirements
1511 1533 preserved: dotencode, fncache, generaldelta, store (no-zstd !)
1512 1534 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1513 1535 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1514 1536 removed: revlogv1
1515 1537 added: exp-revlogv2.2 (zstd !)
1516 1538 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1517 1539
1518 1540 processed revlogs:
1519 1541 - all-filelogs
1520 1542 - changelog
1521 1543 - manifest
1522 1544
1523 1545 $ hg debugformat -v
1524 1546 format-variant repo config default
1525 1547 fncache: yes yes yes
1526 1548 dirstate-v2: no no no
1527 1549 dotencode: yes yes yes
1528 1550 generaldelta: yes yes yes
1529 1551 share-safe: no no no
1530 1552 sparserevlog: yes yes yes
1531 1553 persistent-nodemap: no no no (no-rust !)
1532 1554 persistent-nodemap: yes yes no (rust !)
1533 1555 copies-sdc: no no no
1534 1556 revlog-v2: yes no no
1535 1557 changelog-v2: no no no
1536 1558 plain-cl-delta: yes yes yes
1537 1559 compression: zlib zlib zlib (no-zstd !)
1538 1560 compression: zstd zstd zstd (zstd !)
1539 1561 compression-level: default default default
1540 1562 $ cat .hg/requires
1541 1563 dotencode
1542 1564 exp-revlogv2.2
1543 1565 fncache
1544 1566 generaldelta
1545 1567 persistent-nodemap (rust !)
1546 1568 revlog-compression-zstd (zstd !)
1547 1569 sparserevlog
1548 1570 store
1549 1571 $ hg debugsidedata -c 0
1550 1572 2 sidedata entries
1551 1573 entry-0001 size 4
1552 1574 entry-0002 size 32
1553 1575
1554 1576 downgrade
1555 1577
1556 1578 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1557 1579 upgrade will perform the following actions:
1558 1580
1559 1581 requirements
1560 1582 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1561 1583 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1562 1584 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1563 1585 removed: exp-revlogv2.2
1564 1586 added: revlogv1
1565 1587
1566 1588 processed revlogs:
1567 1589 - all-filelogs
1568 1590 - changelog
1569 1591 - manifest
1570 1592
1571 1593 $ hg debugformat -v
1572 1594 format-variant repo config default
1573 1595 fncache: yes yes yes
1574 1596 dirstate-v2: no no no
1575 1597 dotencode: yes yes yes
1576 1598 generaldelta: yes yes yes
1577 1599 share-safe: no no no
1578 1600 sparserevlog: yes yes yes
1579 1601 persistent-nodemap: no no no (no-rust !)
1580 1602 persistent-nodemap: yes yes no (rust !)
1581 1603 copies-sdc: no no no
1582 1604 revlog-v2: no no no
1583 1605 changelog-v2: no no no
1584 1606 plain-cl-delta: yes yes yes
1585 1607 compression: zlib zlib zlib (no-zstd !)
1586 1608 compression: zstd zstd zstd (zstd !)
1587 1609 compression-level: default default default
1588 1610 $ cat .hg/requires
1589 1611 dotencode
1590 1612 fncache
1591 1613 generaldelta
1592 1614 persistent-nodemap (rust !)
1593 1615 revlog-compression-zstd (zstd !)
1594 1616 revlogv1
1595 1617 sparserevlog
1596 1618 store
1597 1619 $ hg debugsidedata -c 0
1598 1620
1599 1621 upgrade from hgrc
1600 1622
1601 1623 $ cat >> .hg/hgrc << EOF
1602 1624 > [experimental]
1603 1625 > revlogv2=enable-unstable-format-and-corrupt-my-data
1604 1626 > EOF
1605 1627 $ hg debugupgraderepo --run --no-backup --quiet
1606 1628 upgrade will perform the following actions:
1607 1629
1608 1630 requirements
1609 1631 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1610 1632 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1611 1633 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1612 1634 removed: revlogv1
1613 1635 added: exp-revlogv2.2
1614 1636
1615 1637 processed revlogs:
1616 1638 - all-filelogs
1617 1639 - changelog
1618 1640 - manifest
1619 1641
1620 1642 $ hg debugformat -v
1621 1643 format-variant repo config default
1622 1644 fncache: yes yes yes
1623 1645 dirstate-v2: no no no
1624 1646 dotencode: yes yes yes
1625 1647 generaldelta: yes yes yes
1626 1648 share-safe: no no no
1627 1649 sparserevlog: yes yes yes
1628 1650 persistent-nodemap: no no no (no-rust !)
1629 1651 persistent-nodemap: yes yes no (rust !)
1630 1652 copies-sdc: no no no
1631 1653 revlog-v2: yes yes no
1632 1654 changelog-v2: no no no
1633 1655 plain-cl-delta: yes yes yes
1634 1656 compression: zlib zlib zlib (no-zstd !)
1635 1657 compression: zstd zstd zstd (zstd !)
1636 1658 compression-level: default default default
1637 1659 $ cat .hg/requires
1638 1660 dotencode
1639 1661 exp-revlogv2.2
1640 1662 fncache
1641 1663 generaldelta
1642 1664 persistent-nodemap (rust !)
1643 1665 revlog-compression-zstd (zstd !)
1644 1666 sparserevlog
1645 1667 store
1646 1668 $ hg debugsidedata -c 0
1647 1669
1648 1670 Demonstrate that nothing to perform upgrade will still run all the way through
1649 1671
1650 1672 $ hg debugupgraderepo --run
1651 1673 nothing to do
1652 1674
1653 1675 #if no-rust
1654 1676
1655 1677 $ cat << EOF >> $HGRCPATH
1656 1678 > [storage]
1657 1679 > dirstate-v2.slow-path = allow
1658 1680 > EOF
1659 1681
1660 1682 #endif
1661 1683
1662 1684 Upgrade to dirstate-v2
1663 1685
1664 1686 $ hg debugformat -v --config format.exp-rc-dirstate-v2=1 | grep dirstate-v2
1665 1687 dirstate-v2: no yes no
1666 1688 $ hg debugupgraderepo --config format.exp-rc-dirstate-v2=1 --run
1667 1689 upgrade will perform the following actions:
1668 1690
1669 1691 requirements
1670 1692 preserved: * (glob)
1671 1693 added: dirstate-v2
1672 1694
1673 1695 dirstate-v2
1674 1696 "hg status" will be faster
1675 1697
1676 1698 processed revlogs:
1677 1699 - all-filelogs
1678 1700 - changelog
1679 1701 - manifest
1680 1702
1681 1703 beginning upgrade...
1682 1704 repository locked and read-only
1683 1705 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1684 1706 (it is safe to interrupt this process any time before data migration completes)
1685 1707 upgrading to dirstate-v2 from v1
1686 1708 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1687 1709 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1688 1710 $ ls .hg/upgradebackup.*/dirstate
1689 1711 .hg/upgradebackup.*/dirstate (glob)
1690 1712 $ hg debugformat -v | grep dirstate-v2
1691 1713 dirstate-v2: yes no no
1692 1714 $ hg status
1693 1715 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1694 1716 dirstate-v2
1695 1717
1696 1718 Downgrade from dirstate-v2
1697 1719
1698 1720 $ hg debugupgraderepo --run
1699 1721 upgrade will perform the following actions:
1700 1722
1701 1723 requirements
1702 1724 preserved: * (glob)
1703 1725 removed: dirstate-v2
1704 1726
1705 1727 processed revlogs:
1706 1728 - all-filelogs
1707 1729 - changelog
1708 1730 - manifest
1709 1731
1710 1732 beginning upgrade...
1711 1733 repository locked and read-only
1712 1734 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1713 1735 (it is safe to interrupt this process any time before data migration completes)
1714 1736 downgrading from dirstate-v2 to v1
1715 1737 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1716 1738 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1717 1739 $ hg debugformat -v | grep dirstate-v2
1718 1740 dirstate-v2: no no no
1719 1741 $ hg status
1720 1742
1721 1743 $ cd ..
1722 1744
1723 1745 dirstate-v2: upgrade and downgrade from and empty repository:
1724 1746 -------------------------------------------------------------
1725 1747
1726 1748 $ hg init --config format.exp-rc-dirstate-v2=no dirstate-v2-empty
1727 1749 $ cd dirstate-v2-empty
1728 1750 $ hg debugformat | grep dirstate-v2
1729 1751 dirstate-v2: no
1730 1752
1731 1753 upgrade
1732 1754
1733 1755 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=yes
1734 1756 upgrade will perform the following actions:
1735 1757
1736 1758 requirements
1737 1759 preserved: * (glob)
1738 1760 added: dirstate-v2
1739 1761
1740 1762 dirstate-v2
1741 1763 "hg status" will be faster
1742 1764
1743 1765 processed revlogs:
1744 1766 - all-filelogs
1745 1767 - changelog
1746 1768 - manifest
1747 1769
1748 1770 beginning upgrade...
1749 1771 repository locked and read-only
1750 1772 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1751 1773 (it is safe to interrupt this process any time before data migration completes)
1752 1774 upgrading to dirstate-v2 from v1
1753 1775 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1754 1776 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1755 1777 $ hg debugformat | grep dirstate-v2
1756 1778 dirstate-v2: yes
1757 1779
1758 1780 downgrade
1759 1781
1760 1782 $ hg debugupgraderepo --run --config format.exp-rc-dirstate-v2=no
1761 1783 upgrade will perform the following actions:
1762 1784
1763 1785 requirements
1764 1786 preserved: * (glob)
1765 1787 removed: dirstate-v2
1766 1788
1767 1789 processed revlogs:
1768 1790 - all-filelogs
1769 1791 - changelog
1770 1792 - manifest
1771 1793
1772 1794 beginning upgrade...
1773 1795 repository locked and read-only
1774 1796 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1775 1797 (it is safe to interrupt this process any time before data migration completes)
1776 1798 downgrading from dirstate-v2 to v1
1777 1799 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1778 1800 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1779 1801 $ hg debugformat | grep dirstate-v2
1780 1802 dirstate-v2: no
1781 1803
1782 1804 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now