##// END OF EJS Templates
upgrade: don't use `dd status=none` in the test...
marmoute -
r49264:18032c28 stable
parent child Browse files
Show More
@@ -1,1698 +1,1698 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 404 repository lacks features recommended by current config options:
405 405
406 406 fncache
407 407 long and reserved filenames may not work correctly; repository performance is sub-optimal
408 408
409 409 dotencode
410 410 storage of filenames beginning with a period or space may not work correctly
411 411
412 412 generaldelta
413 413 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 414
415 415 sparserevlog
416 416 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 417
418 418 persistent-nodemap (rust !)
419 419 persist the node -> rev mapping on disk to speedup lookup (rust !)
420 420 (rust !)
421 421
422 422 performing an upgrade with "--run" will make the following changes:
423 423
424 424 requirements
425 425 preserved: revlogv1, store
426 426 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
427 427 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
428 428
429 429 fncache
430 430 repository will be more resilient to storing certain paths and performance of certain operations should be improved
431 431
432 432 dotencode
433 433 repository will be better able to store files beginning with a space or period
434 434
435 435 generaldelta
436 436 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 437
438 438 sparserevlog
439 439 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 440
441 441 persistent-nodemap (rust !)
442 442 Speedup revision lookup by node id. (rust !)
443 443 (rust !)
444 444 processed revlogs:
445 445 - all-filelogs
446 446 - changelog
447 447 - manifest
448 448
449 449 additional optimizations are available by specifying "--optimize <name>":
450 450
451 451 re-delta-parent
452 452 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 453
454 454 re-delta-multibase
455 455 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 456
457 457 re-delta-all
458 458 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 459
460 460 re-delta-fulladd
461 461 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 462
463 463 $ hg debugupgraderepo --quiet
464 464 requirements
465 465 preserved: revlogv1, store
466 466 added: dotencode, fncache, generaldelta, sparserevlog (no-rust !)
467 467 added: dotencode, fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
468 468
469 469 processed revlogs:
470 470 - all-filelogs
471 471 - changelog
472 472 - manifest
473 473
474 474
475 475 $ hg --config format.dotencode=false debugupgraderepo
476 476 repository lacks features recommended by current config options:
477 477
478 478 fncache
479 479 long and reserved filenames may not work correctly; repository performance is sub-optimal
480 480
481 481 generaldelta
482 482 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 483
484 484 sparserevlog
485 485 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 486
487 487 persistent-nodemap (rust !)
488 488 persist the node -> rev mapping on disk to speedup lookup (rust !)
489 489 (rust !)
490 490 repository lacks features used by the default config options:
491 491
492 492 dotencode
493 493 storage of filenames beginning with a period or space may not work correctly
494 494
495 495
496 496 performing an upgrade with "--run" will make the following changes:
497 497
498 498 requirements
499 499 preserved: revlogv1, store
500 500 added: fncache, generaldelta, sparserevlog (no-rust !)
501 501 added: fncache, generaldelta, persistent-nodemap, sparserevlog (rust !)
502 502
503 503 fncache
504 504 repository will be more resilient to storing certain paths and performance of certain operations should be improved
505 505
506 506 generaldelta
507 507 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 508
509 509 sparserevlog
510 510 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 511
512 512 persistent-nodemap (rust !)
513 513 Speedup revision lookup by node id. (rust !)
514 514 (rust !)
515 515 processed revlogs:
516 516 - all-filelogs
517 517 - changelog
518 518 - manifest
519 519
520 520 additional optimizations are available by specifying "--optimize <name>":
521 521
522 522 re-delta-parent
523 523 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 524
525 525 re-delta-multibase
526 526 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 527
528 528 re-delta-all
529 529 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 530
531 531 re-delta-fulladd
532 532 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 533
534 534
535 535 $ cd ..
536 536
537 537 Upgrading a repository that is already modern essentially no-ops
538 538
539 539 $ hg init modern
540 540 $ hg -R modern debugupgraderepo --run
541 541 nothing to do
542 542
543 543 Upgrading a repository to generaldelta works
544 544
545 545 $ hg --config format.usegeneraldelta=false init upgradegd
546 546 $ cd upgradegd
547 547 $ touch f0
548 548 $ hg -q commit -A -m initial
549 549 $ mkdir FooBarDirectory.d
550 550 $ touch FooBarDirectory.d/f1
551 551 $ hg -q commit -A -m 'add f1'
552 552 $ hg -q up -r 0
553 553 >>> from __future__ import absolute_import, print_function
554 554 >>> import random
555 555 >>> random.seed(0) # have a reproducible content
556 556 >>> with open("f2", "wb") as f:
557 557 ... for i in range(100000):
558 558 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
559 559 $ hg -q commit -A -m 'add f2'
560 560
561 561 make sure we have a .d file
562 562
563 563 $ ls -d .hg/store/data/*
564 564 .hg/store/data/_foo_bar_directory.d.hg
565 565 .hg/store/data/f0.i
566 566 .hg/store/data/f2.d
567 567 .hg/store/data/f2.i
568 568
569 569 $ hg debugupgraderepo --run --config format.sparse-revlog=false
570 570 upgrade will perform the following actions:
571 571
572 572 requirements
573 573 preserved: dotencode, fncache, revlogv1, store (no-rust !)
574 574 preserved: dotencode, fncache, persistent-nodemap, revlogv1, store (rust !)
575 575 added: generaldelta
576 576
577 577 generaldelta
578 578 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 579
580 580 processed revlogs:
581 581 - all-filelogs
582 582 - changelog
583 583 - manifest
584 584
585 585 beginning upgrade...
586 586 repository locked and read-only
587 587 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
588 588 (it is safe to interrupt this process any time before data migration completes)
589 589 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
590 590 migrating 519 KB in store; 1.05 MB tracked data
591 591 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
592 592 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
593 593 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
594 594 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
595 595 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
596 596 finished migrating 3 changelog revisions; change in size: 0 bytes
597 597 finished migrating 9 total revisions; total change in store size: -17 bytes
598 598 copying phaseroots
599 599 data fully upgraded in a temporary repository
600 600 marking source repository as being upgraded; clients will be unable to read from repository
601 601 starting in-place swap of repository data
602 602 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
603 603 replacing store...
604 604 store replacement complete; repository was inconsistent for *s (glob)
605 605 finalizing requirements file and making repository readable again
606 606 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
607 607 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
608 608 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
609 609
610 610 Original requirements backed up
611 611
612 612 $ cat .hg/upgradebackup.*/requires
613 613 dotencode
614 614 fncache
615 615 persistent-nodemap (rust !)
616 616 revlogv1
617 617 store
618 618
619 619 generaldelta added to original requirements files
620 620
621 621 $ cat .hg/requires
622 622 dotencode
623 623 fncache
624 624 generaldelta
625 625 persistent-nodemap (rust !)
626 626 revlogv1
627 627 store
628 628
629 629 store directory has files we expect
630 630
631 631 $ ls .hg/store
632 632 00changelog.i
633 633 00manifest.i
634 634 data
635 635 fncache
636 636 phaseroots
637 637 undo
638 638 undo.backupfiles
639 639 undo.phaseroots
640 640
641 641 manifest should be generaldelta
642 642
643 643 $ hg debugrevlog -m | grep flags
644 644 flags : inline, generaldelta
645 645
646 646 verify should be happy
647 647
648 648 $ hg verify
649 649 checking changesets
650 650 checking manifests
651 651 crosschecking files in changesets and manifests
652 652 checking files
653 653 checked 3 changesets with 3 changes to 3 files
654 654
655 655 old store should be backed up
656 656
657 657 $ ls -d .hg/upgradebackup.*/
658 658 .hg/upgradebackup.*/ (glob)
659 659 $ ls .hg/upgradebackup.*/store
660 660 00changelog.i
661 661 00manifest.i
662 662 data
663 663 fncache
664 664 phaseroots
665 665 undo
666 666 undo.backup.fncache
667 667 undo.backupfiles
668 668 undo.phaseroots
669 669
670 670 unless --no-backup is passed
671 671
672 672 $ rm -rf .hg/upgradebackup.*/
673 673 $ hg debugupgraderepo --run --no-backup
674 674 upgrade will perform the following actions:
675 675
676 676 requirements
677 677 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
678 678 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
679 679 added: sparserevlog
680 680
681 681 sparserevlog
682 682 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 683
684 684 processed revlogs:
685 685 - all-filelogs
686 686 - changelog
687 687 - manifest
688 688
689 689 beginning upgrade...
690 690 repository locked and read-only
691 691 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
692 692 (it is safe to interrupt this process any time before data migration completes)
693 693 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
694 694 migrating 519 KB in store; 1.05 MB tracked data
695 695 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
696 696 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
697 697 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
698 698 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
699 699 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
700 700 finished migrating 3 changelog revisions; change in size: 0 bytes
701 701 finished migrating 9 total revisions; total change in store size: 0 bytes
702 702 copying phaseroots
703 703 data fully upgraded in a temporary repository
704 704 marking source repository as being upgraded; clients will be unable to read from repository
705 705 starting in-place swap of repository data
706 706 replacing store...
707 707 store replacement complete; repository was inconsistent for * (glob)
708 708 finalizing requirements file and making repository readable again
709 709 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
710 710 $ ls -1 .hg/ | grep upgradebackup
711 711 [1]
712 712
713 713 We can restrict optimization to some revlog:
714 714
715 715 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
716 716 upgrade will perform the following actions:
717 717
718 718 requirements
719 719 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
720 720 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
721 721
722 722 optimisations: re-delta-parent
723 723
724 724 re-delta-parent
725 725 deltas within internal storage will choose a new base revision if needed
726 726
727 727 processed revlogs:
728 728 - manifest
729 729
730 730 beginning upgrade...
731 731 repository locked and read-only
732 732 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
733 733 (it is safe to interrupt this process any time before data migration completes)
734 734 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
735 735 migrating 519 KB in store; 1.05 MB tracked data
736 736 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
737 737 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
738 738 blindly copying data/f0.i containing 1 revisions
739 739 blindly copying data/f2.i containing 1 revisions
740 740 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
741 741 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
742 742 cloning 3 revisions from 00manifest.i
743 743 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
744 744 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
745 745 blindly copying 00changelog.i containing 3 revisions
746 746 finished migrating 3 changelog revisions; change in size: 0 bytes
747 747 finished migrating 9 total revisions; total change in store size: 0 bytes
748 748 copying phaseroots
749 749 data fully upgraded in a temporary repository
750 750 marking source repository as being upgraded; clients will be unable to read from repository
751 751 starting in-place swap of repository data
752 752 replacing store...
753 753 store replacement complete; repository was inconsistent for *s (glob)
754 754 finalizing requirements file and making repository readable again
755 755 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
756 756
757 757 Check that the repo still works fine
758 758
759 759 $ hg log -G --stat
760 760 @ changeset: 2:76d4395f5413 (no-py3 !)
761 761 @ changeset: 2:fca376863211 (py3 !)
762 762 | tag: tip
763 763 | parent: 0:ba592bf28da2
764 764 | user: test
765 765 | date: Thu Jan 01 00:00:00 1970 +0000
766 766 | summary: add f2
767 767 |
768 768 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
769 769 | 1 files changed, 100000 insertions(+), 0 deletions(-)
770 770 |
771 771 | o changeset: 1:2029ce2354e2
772 772 |/ user: test
773 773 | date: Thu Jan 01 00:00:00 1970 +0000
774 774 | summary: add f1
775 775 |
776 776 |
777 777 o changeset: 0:ba592bf28da2
778 778 user: test
779 779 date: Thu Jan 01 00:00:00 1970 +0000
780 780 summary: initial
781 781
782 782
783 783
784 784 $ hg verify
785 785 checking changesets
786 786 checking manifests
787 787 crosschecking files in changesets and manifests
788 788 checking files
789 789 checked 3 changesets with 3 changes to 3 files
790 790
791 791 Check we can select negatively
792 792
793 793 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
794 794 upgrade will perform the following actions:
795 795
796 796 requirements
797 797 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
798 798 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
799 799
800 800 optimisations: re-delta-parent
801 801
802 802 re-delta-parent
803 803 deltas within internal storage will choose a new base revision if needed
804 804
805 805 processed revlogs:
806 806 - all-filelogs
807 807 - changelog
808 808
809 809 beginning upgrade...
810 810 repository locked and read-only
811 811 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
812 812 (it is safe to interrupt this process any time before data migration completes)
813 813 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
814 814 migrating 519 KB in store; 1.05 MB tracked data
815 815 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
816 816 cloning 1 revisions from data/FooBarDirectory.d/f1.i
817 817 cloning 1 revisions from data/f0.i
818 818 cloning 1 revisions from data/f2.i
819 819 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
820 820 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
821 821 blindly copying 00manifest.i containing 3 revisions
822 822 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
823 823 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
824 824 cloning 3 revisions from 00changelog.i
825 825 finished migrating 3 changelog revisions; change in size: 0 bytes
826 826 finished migrating 9 total revisions; total change in store size: 0 bytes
827 827 copying phaseroots
828 828 data fully upgraded in a temporary repository
829 829 marking source repository as being upgraded; clients will be unable to read from repository
830 830 starting in-place swap of repository data
831 831 replacing store...
832 832 store replacement complete; repository was inconsistent for *s (glob)
833 833 finalizing requirements file and making repository readable again
834 834 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
835 835 $ hg verify
836 836 checking changesets
837 837 checking manifests
838 838 crosschecking files in changesets and manifests
839 839 checking files
840 840 checked 3 changesets with 3 changes to 3 files
841 841
842 842 Check that we can select changelog only
843 843
844 844 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
845 845 upgrade will perform the following actions:
846 846
847 847 requirements
848 848 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
849 849 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
850 850
851 851 optimisations: re-delta-parent
852 852
853 853 re-delta-parent
854 854 deltas within internal storage will choose a new base revision if needed
855 855
856 856 processed revlogs:
857 857 - changelog
858 858
859 859 beginning upgrade...
860 860 repository locked and read-only
861 861 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
862 862 (it is safe to interrupt this process any time before data migration completes)
863 863 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
864 864 migrating 519 KB in store; 1.05 MB tracked data
865 865 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
866 866 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
867 867 blindly copying data/f0.i containing 1 revisions
868 868 blindly copying data/f2.i containing 1 revisions
869 869 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
870 870 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
871 871 blindly copying 00manifest.i containing 3 revisions
872 872 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
873 873 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
874 874 cloning 3 revisions from 00changelog.i
875 875 finished migrating 3 changelog revisions; change in size: 0 bytes
876 876 finished migrating 9 total revisions; total change in store size: 0 bytes
877 877 copying phaseroots
878 878 data fully upgraded in a temporary repository
879 879 marking source repository as being upgraded; clients will be unable to read from repository
880 880 starting in-place swap of repository data
881 881 replacing store...
882 882 store replacement complete; repository was inconsistent for *s (glob)
883 883 finalizing requirements file and making repository readable again
884 884 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
885 885 $ hg verify
886 886 checking changesets
887 887 checking manifests
888 888 crosschecking files in changesets and manifests
889 889 checking files
890 890 checked 3 changesets with 3 changes to 3 files
891 891
892 892 Check that we can select filelog only
893 893
894 894 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
895 895 upgrade will perform the following actions:
896 896
897 897 requirements
898 898 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
899 899 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
900 900
901 901 optimisations: re-delta-parent
902 902
903 903 re-delta-parent
904 904 deltas within internal storage will choose a new base revision if needed
905 905
906 906 processed revlogs:
907 907 - all-filelogs
908 908
909 909 beginning upgrade...
910 910 repository locked and read-only
911 911 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
912 912 (it is safe to interrupt this process any time before data migration completes)
913 913 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
914 914 migrating 519 KB in store; 1.05 MB tracked data
915 915 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
916 916 cloning 1 revisions from data/FooBarDirectory.d/f1.i
917 917 cloning 1 revisions from data/f0.i
918 918 cloning 1 revisions from data/f2.i
919 919 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
920 920 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
921 921 blindly copying 00manifest.i containing 3 revisions
922 922 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
923 923 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
924 924 blindly copying 00changelog.i containing 3 revisions
925 925 finished migrating 3 changelog revisions; change in size: 0 bytes
926 926 finished migrating 9 total revisions; total change in store size: 0 bytes
927 927 copying phaseroots
928 928 data fully upgraded in a temporary repository
929 929 marking source repository as being upgraded; clients will be unable to read from repository
930 930 starting in-place swap of repository data
931 931 replacing store...
932 932 store replacement complete; repository was inconsistent for *s (glob)
933 933 finalizing requirements file and making repository readable again
934 934 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
935 935 $ hg verify
936 936 checking changesets
937 937 checking manifests
938 938 crosschecking files in changesets and manifests
939 939 checking files
940 940 checked 3 changesets with 3 changes to 3 files
941 941
942 942
943 943 Check you can't skip revlog clone during important format downgrade
944 944
945 945 $ echo "[format]" > .hg/hgrc
946 946 $ echo "sparse-revlog=no" >> .hg/hgrc
947 947 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
948 948 ignoring revlogs selection flags, format requirements change: sparserevlog
949 949 upgrade will perform the following actions:
950 950
951 951 requirements
952 952 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
953 953 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
954 954 removed: sparserevlog
955 955
956 956 optimisations: re-delta-parent
957 957
958 958 re-delta-parent
959 959 deltas within internal storage will choose a new base revision if needed
960 960
961 961 processed revlogs:
962 962 - all-filelogs
963 963 - changelog
964 964 - manifest
965 965
966 966 beginning upgrade...
967 967 repository locked and read-only
968 968 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
969 969 (it is safe to interrupt this process any time before data migration completes)
970 970 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
971 971 migrating 519 KB in store; 1.05 MB tracked data
972 972 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
973 973 cloning 1 revisions from data/FooBarDirectory.d/f1.i
974 974 cloning 1 revisions from data/f0.i
975 975 cloning 1 revisions from data/f2.i
976 976 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
977 977 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
978 978 cloning 3 revisions from 00manifest.i
979 979 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
980 980 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
981 981 cloning 3 revisions from 00changelog.i
982 982 finished migrating 3 changelog revisions; change in size: 0 bytes
983 983 finished migrating 9 total revisions; total change in store size: 0 bytes
984 984 copying phaseroots
985 985 data fully upgraded in a temporary repository
986 986 marking source repository as being upgraded; clients will be unable to read from repository
987 987 starting in-place swap of repository data
988 988 replacing store...
989 989 store replacement complete; repository was inconsistent for *s (glob)
990 990 finalizing requirements file and making repository readable again
991 991 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
992 992 $ hg verify
993 993 checking changesets
994 994 checking manifests
995 995 crosschecking files in changesets and manifests
996 996 checking files
997 997 checked 3 changesets with 3 changes to 3 files
998 998
999 999 Check you can't skip revlog clone during important format upgrade
1000 1000
1001 1001 $ echo "sparse-revlog=yes" >> .hg/hgrc
1002 1002 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1003 1003 ignoring revlogs selection flags, format requirements change: sparserevlog
1004 1004 upgrade will perform the following actions:
1005 1005
1006 1006 requirements
1007 1007 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1008 1008 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1009 1009 added: sparserevlog
1010 1010
1011 1011 optimisations: re-delta-parent
1012 1012
1013 1013 sparserevlog
1014 1014 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.
1015 1015
1016 1016 re-delta-parent
1017 1017 deltas within internal storage will choose a new base revision if needed
1018 1018
1019 1019 processed revlogs:
1020 1020 - all-filelogs
1021 1021 - changelog
1022 1022 - manifest
1023 1023
1024 1024 beginning upgrade...
1025 1025 repository locked and read-only
1026 1026 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1027 1027 (it is safe to interrupt this process any time before data migration completes)
1028 1028 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1029 1029 migrating 519 KB in store; 1.05 MB tracked data
1030 1030 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1031 1031 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1032 1032 cloning 1 revisions from data/f0.i
1033 1033 cloning 1 revisions from data/f2.i
1034 1034 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1035 1035 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1036 1036 cloning 3 revisions from 00manifest.i
1037 1037 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1038 1038 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1039 1039 cloning 3 revisions from 00changelog.i
1040 1040 finished migrating 3 changelog revisions; change in size: 0 bytes
1041 1041 finished migrating 9 total revisions; total change in store size: 0 bytes
1042 1042 copying phaseroots
1043 1043 data fully upgraded in a temporary repository
1044 1044 marking source repository as being upgraded; clients will be unable to read from repository
1045 1045 starting in-place swap of repository data
1046 1046 replacing store...
1047 1047 store replacement complete; repository was inconsistent for *s (glob)
1048 1048 finalizing requirements file and making repository readable again
1049 1049 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1050 1050 $ hg verify
1051 1051 checking changesets
1052 1052 checking manifests
1053 1053 crosschecking files in changesets and manifests
1054 1054 checking files
1055 1055 checked 3 changesets with 3 changes to 3 files
1056 1056
1057 1057 $ cd ..
1058 1058
1059 1059 store files with special filenames aren't encoded during copy
1060 1060
1061 1061 $ hg init store-filenames
1062 1062 $ cd store-filenames
1063 1063 $ touch foo
1064 1064 $ hg -q commit -A -m initial
1065 1065 $ touch .hg/store/.XX_special_filename
1066 1066
1067 1067 $ hg debugupgraderepo --run
1068 1068 nothing to do
1069 1069 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1070 1070 upgrade will perform the following actions:
1071 1071
1072 1072 requirements
1073 1073 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1074 1074 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1075 1075
1076 1076 optimisations: re-delta-fulladd
1077 1077
1078 1078 re-delta-fulladd
1079 1079 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
1080 1080
1081 1081 processed revlogs:
1082 1082 - all-filelogs
1083 1083 - changelog
1084 1084 - manifest
1085 1085
1086 1086 beginning upgrade...
1087 1087 repository locked and read-only
1088 1088 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1089 1089 (it is safe to interrupt this process any time before data migration completes)
1090 1090 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1091 1091 migrating 301 bytes in store; 107 bytes tracked data
1092 1092 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1093 1093 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1094 1094 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1095 1095 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1096 1096 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1097 1097 finished migrating 1 changelog revisions; change in size: 0 bytes
1098 1098 finished migrating 3 total revisions; total change in store size: 0 bytes
1099 1099 copying .XX_special_filename
1100 1100 copying phaseroots
1101 1101 data fully upgraded in a temporary repository
1102 1102 marking source repository as being upgraded; clients will be unable to read from repository
1103 1103 starting in-place swap of repository data
1104 1104 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1105 1105 replacing store...
1106 1106 store replacement complete; repository was inconsistent for *s (glob)
1107 1107 finalizing requirements file and making repository readable again
1108 1108 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1109 1109 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1110 1110 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1111 1111
1112 1112 fncache is valid after upgrade
1113 1113
1114 1114 $ hg debugrebuildfncache
1115 1115 fncache already up to date
1116 1116
1117 1117 $ cd ..
1118 1118
1119 1119 Check upgrading a large file repository
1120 1120 ---------------------------------------
1121 1121
1122 1122 $ hg init largefilesrepo
1123 1123 $ cat << EOF >> largefilesrepo/.hg/hgrc
1124 1124 > [extensions]
1125 1125 > largefiles =
1126 1126 > EOF
1127 1127
1128 1128 $ cd largefilesrepo
1129 1129 $ touch foo
1130 1130 $ hg add --large foo
1131 1131 $ hg -q commit -m initial
1132 1132 $ cat .hg/requires
1133 1133 dotencode
1134 1134 fncache
1135 1135 generaldelta
1136 1136 largefiles
1137 1137 persistent-nodemap (rust !)
1138 1138 revlogv1
1139 1139 sparserevlog
1140 1140 store
1141 1141
1142 1142 $ hg debugupgraderepo --run
1143 1143 nothing to do
1144 1144 $ cat .hg/requires
1145 1145 dotencode
1146 1146 fncache
1147 1147 generaldelta
1148 1148 largefiles
1149 1149 persistent-nodemap (rust !)
1150 1150 revlogv1
1151 1151 sparserevlog
1152 1152 store
1153 1153
1154 1154 $ cat << EOF >> .hg/hgrc
1155 1155 > [extensions]
1156 1156 > lfs =
1157 1157 > [lfs]
1158 1158 > threshold = 10
1159 1159 > EOF
1160 1160 $ echo '123456789012345' > lfs.bin
1161 1161 $ hg ci -Am 'lfs.bin'
1162 1162 adding lfs.bin
1163 1163 $ grep lfs .hg/requires
1164 1164 lfs
1165 1165 $ find .hg/store/lfs -type f
1166 1166 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1167 1167
1168 1168 $ hg debugupgraderepo --run
1169 1169 nothing to do
1170 1170
1171 1171 $ grep lfs .hg/requires
1172 1172 lfs
1173 1173 $ find .hg/store/lfs -type f
1174 1174 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1175 1175 $ hg verify
1176 1176 checking changesets
1177 1177 checking manifests
1178 1178 crosschecking files in changesets and manifests
1179 1179 checking files
1180 1180 checked 2 changesets with 2 changes to 2 files
1181 1181 $ hg debugdata lfs.bin 0
1182 1182 version https://git-lfs.github.com/spec/v1
1183 1183 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1184 1184 size 16
1185 1185 x-is-binary 0
1186 1186
1187 1187 $ cd ..
1188 1188
1189 1189 repository config is taken in account
1190 1190 -------------------------------------
1191 1191
1192 1192 $ cat << EOF >> $HGRCPATH
1193 1193 > [format]
1194 1194 > maxchainlen = 1
1195 1195 > EOF
1196 1196
1197 1197 $ hg init localconfig
1198 1198 $ cd localconfig
1199 1199 $ cat << EOF > file
1200 1200 > some content
1201 1201 > with some length
1202 1202 > to make sure we get a delta
1203 1203 > after changes
1204 1204 > very long
1205 1205 > very long
1206 1206 > very long
1207 1207 > very long
1208 1208 > very long
1209 1209 > very long
1210 1210 > very long
1211 1211 > very long
1212 1212 > very long
1213 1213 > very long
1214 1214 > very long
1215 1215 > EOF
1216 1216 $ hg -q commit -A -m A
1217 1217 $ echo "new line" >> file
1218 1218 $ hg -q commit -m B
1219 1219 $ echo "new line" >> file
1220 1220 $ hg -q commit -m C
1221 1221
1222 1222 $ cat << EOF >> .hg/hgrc
1223 1223 > [format]
1224 1224 > maxchainlen = 9001
1225 1225 > EOF
1226 1226 $ hg config format
1227 1227 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1228 1228 format.maxchainlen=9001
1229 1229 $ hg debugdeltachain file
1230 1230 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1231 1231 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1232 1232 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1233 1233 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1234 1234
1235 1235 $ hg debugupgraderepo --run --optimize 're-delta-all'
1236 1236 upgrade will perform the following actions:
1237 1237
1238 1238 requirements
1239 1239 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1240 1240 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1241 1241
1242 1242 optimisations: re-delta-all
1243 1243
1244 1244 re-delta-all
1245 1245 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1246 1246
1247 1247 processed revlogs:
1248 1248 - all-filelogs
1249 1249 - changelog
1250 1250 - manifest
1251 1251
1252 1252 beginning upgrade...
1253 1253 repository locked and read-only
1254 1254 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1255 1255 (it is safe to interrupt this process any time before data migration completes)
1256 1256 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1257 1257 migrating 1019 bytes in store; 882 bytes tracked data
1258 1258 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1259 1259 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1260 1260 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1261 1261 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1262 1262 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1263 1263 finished migrating 3 changelog revisions; change in size: 0 bytes
1264 1264 finished migrating 9 total revisions; total change in store size: -9 bytes
1265 1265 copying phaseroots
1266 1266 data fully upgraded in a temporary repository
1267 1267 marking source repository as being upgraded; clients will be unable to read from repository
1268 1268 starting in-place swap of repository data
1269 1269 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1270 1270 replacing store...
1271 1271 store replacement complete; repository was inconsistent for *s (glob)
1272 1272 finalizing requirements file and making repository readable again
1273 1273 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1274 1274 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1275 1275 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1276 1276 $ hg debugdeltachain file
1277 1277 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1278 1278 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1279 1279 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1280 1280 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1281 1281 $ cd ..
1282 1282
1283 1283 $ cat << EOF >> $HGRCPATH
1284 1284 > [format]
1285 1285 > maxchainlen = 9001
1286 1286 > EOF
1287 1287
1288 1288 Check upgrading a sparse-revlog repository
1289 1289 ---------------------------------------
1290 1290
1291 1291 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1292 1292 $ cd sparserevlogrepo
1293 1293 $ touch foo
1294 1294 $ hg add foo
1295 1295 $ hg -q commit -m "foo"
1296 1296 $ cat .hg/requires
1297 1297 dotencode
1298 1298 fncache
1299 1299 generaldelta
1300 1300 persistent-nodemap (rust !)
1301 1301 revlogv1
1302 1302 store
1303 1303
1304 1304 Check that we can add the sparse-revlog format requirement
1305 1305 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1306 1306 upgrade will perform the following actions:
1307 1307
1308 1308 requirements
1309 1309 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1310 1310 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1311 1311 added: sparserevlog
1312 1312
1313 1313 processed revlogs:
1314 1314 - all-filelogs
1315 1315 - changelog
1316 1316 - manifest
1317 1317
1318 1318 $ cat .hg/requires
1319 1319 dotencode
1320 1320 fncache
1321 1321 generaldelta
1322 1322 persistent-nodemap (rust !)
1323 1323 revlogv1
1324 1324 sparserevlog
1325 1325 store
1326 1326
1327 1327 Check that we can remove the sparse-revlog format requirement
1328 1328 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1329 1329 upgrade will perform the following actions:
1330 1330
1331 1331 requirements
1332 1332 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1333 1333 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1334 1334 removed: sparserevlog
1335 1335
1336 1336 processed revlogs:
1337 1337 - all-filelogs
1338 1338 - changelog
1339 1339 - manifest
1340 1340
1341 1341 $ cat .hg/requires
1342 1342 dotencode
1343 1343 fncache
1344 1344 generaldelta
1345 1345 persistent-nodemap (rust !)
1346 1346 revlogv1
1347 1347 store
1348 1348
1349 1349 #if zstd
1350 1350
1351 1351 Check upgrading to a zstd revlog
1352 1352 --------------------------------
1353 1353
1354 1354 upgrade
1355 1355
1356 1356 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1357 1357 upgrade will perform the following actions:
1358 1358
1359 1359 requirements
1360 1360 preserved: dotencode, fncache, generaldelta, revlogv1, store (no-rust !)
1361 1361 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, store (rust !)
1362 1362 added: revlog-compression-zstd, sparserevlog
1363 1363
1364 1364 processed revlogs:
1365 1365 - all-filelogs
1366 1366 - changelog
1367 1367 - manifest
1368 1368
1369 1369 $ hg debugformat -v
1370 1370 format-variant repo config default
1371 1371 fncache: yes yes yes
1372 1372 dirstate-v2: no no no
1373 1373 dotencode: yes yes yes
1374 1374 generaldelta: yes yes yes
1375 1375 share-safe: no no no
1376 1376 sparserevlog: yes yes yes
1377 1377 persistent-nodemap: no no no (no-rust !)
1378 1378 persistent-nodemap: yes yes no (rust !)
1379 1379 copies-sdc: no no no
1380 1380 revlog-v2: no no no
1381 1381 changelog-v2: no no no
1382 1382 plain-cl-delta: yes yes yes
1383 1383 compression: zlib zlib zlib (no-zstd !)
1384 1384 compression: zstd zlib zstd (zstd !)
1385 1385 compression-level: default default default
1386 1386 $ cat .hg/requires
1387 1387 dotencode
1388 1388 fncache
1389 1389 generaldelta
1390 1390 persistent-nodemap (rust !)
1391 1391 revlog-compression-zstd
1392 1392 revlogv1
1393 1393 sparserevlog
1394 1394 store
1395 1395
1396 1396 downgrade
1397 1397
1398 1398 $ hg debugupgraderepo --run --no-backup --quiet
1399 1399 upgrade will perform the following actions:
1400 1400
1401 1401 requirements
1402 1402 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1403 1403 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1404 1404 removed: revlog-compression-zstd
1405 1405
1406 1406 processed revlogs:
1407 1407 - all-filelogs
1408 1408 - changelog
1409 1409 - manifest
1410 1410
1411 1411 $ hg debugformat -v
1412 1412 format-variant repo config default
1413 1413 fncache: yes yes yes
1414 1414 dirstate-v2: no no no
1415 1415 dotencode: yes yes yes
1416 1416 generaldelta: yes yes yes
1417 1417 share-safe: no no no
1418 1418 sparserevlog: yes yes yes
1419 1419 persistent-nodemap: no no no (no-rust !)
1420 1420 persistent-nodemap: yes yes no (rust !)
1421 1421 copies-sdc: no no no
1422 1422 revlog-v2: no no no
1423 1423 changelog-v2: no no no
1424 1424 plain-cl-delta: yes yes yes
1425 1425 compression: zlib zlib zlib (no-zstd !)
1426 1426 compression: zlib zlib zstd (zstd !)
1427 1427 compression-level: default default default
1428 1428 $ cat .hg/requires
1429 1429 dotencode
1430 1430 fncache
1431 1431 generaldelta
1432 1432 persistent-nodemap (rust !)
1433 1433 revlogv1
1434 1434 sparserevlog
1435 1435 store
1436 1436
1437 1437 upgrade from hgrc
1438 1438
1439 1439 $ cat >> .hg/hgrc << EOF
1440 1440 > [format]
1441 1441 > revlog-compression=zstd
1442 1442 > EOF
1443 1443 $ hg debugupgraderepo --run --no-backup --quiet
1444 1444 upgrade will perform the following actions:
1445 1445
1446 1446 requirements
1447 1447 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store (no-rust !)
1448 1448 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store (rust !)
1449 1449 added: revlog-compression-zstd
1450 1450
1451 1451 processed revlogs:
1452 1452 - all-filelogs
1453 1453 - changelog
1454 1454 - manifest
1455 1455
1456 1456 $ hg debugformat -v
1457 1457 format-variant repo config default
1458 1458 fncache: yes yes yes
1459 1459 dirstate-v2: no no no
1460 1460 dotencode: yes yes yes
1461 1461 generaldelta: yes yes yes
1462 1462 share-safe: no no no
1463 1463 sparserevlog: yes yes yes
1464 1464 persistent-nodemap: no no no (no-rust !)
1465 1465 persistent-nodemap: yes yes no (rust !)
1466 1466 copies-sdc: no no no
1467 1467 revlog-v2: no no no
1468 1468 changelog-v2: no no no
1469 1469 plain-cl-delta: yes yes yes
1470 1470 compression: zlib zlib zlib (no-zstd !)
1471 1471 compression: zstd zstd zstd (zstd !)
1472 1472 compression-level: default default default
1473 1473 $ cat .hg/requires
1474 1474 dotencode
1475 1475 fncache
1476 1476 generaldelta
1477 1477 persistent-nodemap (rust !)
1478 1478 revlog-compression-zstd
1479 1479 revlogv1
1480 1480 sparserevlog
1481 1481 store
1482 1482
1483 1483 #endif
1484 1484
1485 1485 Check upgrading to a revlog format supporting sidedata
1486 1486 ------------------------------------------------------
1487 1487
1488 1488 upgrade
1489 1489
1490 1490 $ hg debugsidedata -c 0
1491 1491 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1492 1492 upgrade will perform the following actions:
1493 1493
1494 1494 requirements
1495 1495 preserved: dotencode, fncache, generaldelta, store (no-zstd !)
1496 1496 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1497 1497 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1498 1498 removed: revlogv1
1499 1499 added: exp-revlogv2.2 (zstd !)
1500 1500 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1501 1501
1502 1502 processed revlogs:
1503 1503 - all-filelogs
1504 1504 - changelog
1505 1505 - manifest
1506 1506
1507 1507 $ hg debugformat -v
1508 1508 format-variant repo config default
1509 1509 fncache: yes yes yes
1510 1510 dirstate-v2: no no no
1511 1511 dotencode: yes yes yes
1512 1512 generaldelta: yes yes yes
1513 1513 share-safe: no no no
1514 1514 sparserevlog: yes yes yes
1515 1515 persistent-nodemap: no no no (no-rust !)
1516 1516 persistent-nodemap: yes yes no (rust !)
1517 1517 copies-sdc: no no no
1518 1518 revlog-v2: yes no no
1519 1519 changelog-v2: no no no
1520 1520 plain-cl-delta: yes yes yes
1521 1521 compression: zlib zlib zlib (no-zstd !)
1522 1522 compression: zstd zstd zstd (zstd !)
1523 1523 compression-level: default default default
1524 1524 $ cat .hg/requires
1525 1525 dotencode
1526 1526 exp-revlogv2.2
1527 1527 fncache
1528 1528 generaldelta
1529 1529 persistent-nodemap (rust !)
1530 1530 revlog-compression-zstd (zstd !)
1531 1531 sparserevlog
1532 1532 store
1533 1533 $ hg debugsidedata -c 0
1534 1534 2 sidedata entries
1535 1535 entry-0001 size 4
1536 1536 entry-0002 size 32
1537 1537
1538 1538 downgrade
1539 1539
1540 1540 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1541 1541 upgrade will perform the following actions:
1542 1542
1543 1543 requirements
1544 1544 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1545 1545 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1546 1546 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1547 1547 removed: exp-revlogv2.2
1548 1548 added: revlogv1
1549 1549
1550 1550 processed revlogs:
1551 1551 - all-filelogs
1552 1552 - changelog
1553 1553 - manifest
1554 1554
1555 1555 $ hg debugformat -v
1556 1556 format-variant repo config default
1557 1557 fncache: yes yes yes
1558 1558 dirstate-v2: no no no
1559 1559 dotencode: yes yes yes
1560 1560 generaldelta: yes yes yes
1561 1561 share-safe: no no no
1562 1562 sparserevlog: yes yes yes
1563 1563 persistent-nodemap: no no no (no-rust !)
1564 1564 persistent-nodemap: yes yes no (rust !)
1565 1565 copies-sdc: no no no
1566 1566 revlog-v2: no no no
1567 1567 changelog-v2: no no no
1568 1568 plain-cl-delta: yes yes yes
1569 1569 compression: zlib zlib zlib (no-zstd !)
1570 1570 compression: zstd zstd zstd (zstd !)
1571 1571 compression-level: default default default
1572 1572 $ cat .hg/requires
1573 1573 dotencode
1574 1574 fncache
1575 1575 generaldelta
1576 1576 persistent-nodemap (rust !)
1577 1577 revlog-compression-zstd (zstd !)
1578 1578 revlogv1
1579 1579 sparserevlog
1580 1580 store
1581 1581 $ hg debugsidedata -c 0
1582 1582
1583 1583 upgrade from hgrc
1584 1584
1585 1585 $ cat >> .hg/hgrc << EOF
1586 1586 > [experimental]
1587 1587 > revlogv2=enable-unstable-format-and-corrupt-my-data
1588 1588 > EOF
1589 1589 $ hg debugupgraderepo --run --no-backup --quiet
1590 1590 upgrade will perform the following actions:
1591 1591
1592 1592 requirements
1593 1593 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1594 1594 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd no-rust !)
1595 1595 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store (rust !)
1596 1596 removed: revlogv1
1597 1597 added: exp-revlogv2.2
1598 1598
1599 1599 processed revlogs:
1600 1600 - all-filelogs
1601 1601 - changelog
1602 1602 - manifest
1603 1603
1604 1604 $ hg debugformat -v
1605 1605 format-variant repo config default
1606 1606 fncache: yes yes yes
1607 1607 dirstate-v2: no no no
1608 1608 dotencode: yes yes yes
1609 1609 generaldelta: yes yes yes
1610 1610 share-safe: no no no
1611 1611 sparserevlog: yes yes yes
1612 1612 persistent-nodemap: no no no (no-rust !)
1613 1613 persistent-nodemap: yes yes no (rust !)
1614 1614 copies-sdc: no no no
1615 1615 revlog-v2: yes yes no
1616 1616 changelog-v2: no no no
1617 1617 plain-cl-delta: yes yes yes
1618 1618 compression: zlib zlib zlib (no-zstd !)
1619 1619 compression: zstd zstd zstd (zstd !)
1620 1620 compression-level: default default default
1621 1621 $ cat .hg/requires
1622 1622 dotencode
1623 1623 exp-revlogv2.2
1624 1624 fncache
1625 1625 generaldelta
1626 1626 persistent-nodemap (rust !)
1627 1627 revlog-compression-zstd (zstd !)
1628 1628 sparserevlog
1629 1629 store
1630 1630 $ hg debugsidedata -c 0
1631 1631
1632 1632 Demonstrate that nothing to perform upgrade will still run all the way through
1633 1633
1634 1634 $ hg debugupgraderepo --run
1635 1635 nothing to do
1636 1636
1637 1637 #if rust
1638 1638
1639 1639 Upgrade to dirstate-v2
1640 1640
1641 1641 $ hg debugformat -v --config format.exp-rc-dirstate-v2=1 | grep dirstate-v2
1642 1642 dirstate-v2: no yes no
1643 1643 $ hg debugupgraderepo --config format.exp-rc-dirstate-v2=1 --run
1644 1644 upgrade will perform the following actions:
1645 1645
1646 1646 requirements
1647 1647 preserved: dotencode, exp-revlogv2.2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store
1648 1648 added: dirstate-v2
1649 1649
1650 1650 dirstate-v2
1651 1651 "hg status" will be faster
1652 1652
1653 1653 processed revlogs:
1654 1654 - all-filelogs
1655 1655 - changelog
1656 1656 - manifest
1657 1657
1658 1658 beginning upgrade...
1659 1659 repository locked and read-only
1660 1660 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1661 1661 (it is safe to interrupt this process any time before data migration completes)
1662 1662 upgrading to dirstate-v2 from v1
1663 1663 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1664 1664 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1665 1665 $ ls .hg/upgradebackup.*/dirstate
1666 1666 .hg/upgradebackup.*/dirstate (glob)
1667 1667 $ hg debugformat -v | grep dirstate-v2
1668 1668 dirstate-v2: yes no no
1669 1669 $ hg status
1670 $ dd status=none bs=12 count=1 if=.hg/dirstate
1670 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1671 1671 dirstate-v2
1672 1672
1673 1673 Downgrade from dirstate-v2
1674 1674
1675 1675 $ hg debugupgraderepo --run
1676 1676 upgrade will perform the following actions:
1677 1677
1678 1678 requirements
1679 1679 preserved: dotencode, exp-revlogv2.2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, sparserevlog, store
1680 1680 removed: dirstate-v2
1681 1681
1682 1682 processed revlogs:
1683 1683 - all-filelogs
1684 1684 - changelog
1685 1685 - manifest
1686 1686
1687 1687 beginning upgrade...
1688 1688 repository locked and read-only
1689 1689 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1690 1690 (it is safe to interrupt this process any time before data migration completes)
1691 1691 downgrading from dirstate-v2 to v1
1692 1692 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1693 1693 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1694 1694 $ hg debugformat -v | grep dirstate-v2
1695 1695 dirstate-v2: no no no
1696 1696 $ hg status
1697 1697
1698 1698 #endif
General Comments 0
You need to be logged in to leave comments. Login now