##// END OF EJS Templates
test: explicitly use zlib compression in tests/test-upgrade-repo.t...
marmoute -
r47608:1a17c35f default
parent child Browse files
Show More
@@ -1,1516 +1,1520 b''
1 1 #require no-reposimplestore
2 2
3 3 $ cat >> $HGRCPATH << EOF
4 4 > [extensions]
5 5 > share =
6 > [format]
7 > # stabilize test accross variant
8 > revlog-compression=zlib
6 9 > EOF
7 10
8 11 store and revlogv1 are required in source
9 12
10 13 $ hg --config format.usestore=false init no-store
11 14 $ hg -R no-store debugupgraderepo
12 15 abort: cannot upgrade repository; requirement missing: store
13 16 [255]
14 17
15 18 $ hg init no-revlogv1
16 19 $ cat > no-revlogv1/.hg/requires << EOF
17 20 > dotencode
18 21 > fncache
19 22 > generaldelta
20 23 > store
21 24 > EOF
22 25
23 26 $ hg -R no-revlogv1 debugupgraderepo
24 27 abort: cannot upgrade repository; missing a revlog version
25 28 [255]
26 29
27 30 Cannot upgrade shared repositories
28 31
29 32 $ hg init share-parent
30 33 $ hg -q share share-parent share-child
31 34
32 35 $ hg -R share-child debugupgraderepo
33 36 abort: cannot upgrade repository; unsupported source requirement: shared
34 37 [255]
35 38
36 39 Do not yet support upgrading treemanifest repos
37 40
38 41 $ hg --config experimental.treemanifest=true init treemanifest
39 42 $ hg -R treemanifest debugupgraderepo
40 43 abort: cannot upgrade repository; unsupported source requirement: treemanifest
41 44 [255]
42 45
43 46 Cannot add treemanifest requirement during upgrade
44 47
45 48 $ hg init disallowaddedreq
46 49 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
47 50 abort: cannot upgrade repository; do not support adding requirement: treemanifest
48 51 [255]
49 52
50 53 An upgrade of a repository created with recommended settings only suggests optimizations
51 54
52 55 $ hg init empty
53 56 $ cd empty
54 57 $ hg debugformat
55 58 format-variant repo
56 59 fncache: yes
57 60 dotencode: yes
58 61 generaldelta: yes
59 62 share-safe: no
60 63 sparserevlog: yes
61 64 persistent-nodemap: no
62 65 copies-sdc: no
63 66 revlog-v2: no
64 67 plain-cl-delta: yes
65 68 compression: zlib
66 69 compression-level: default
67 70 $ hg debugformat --verbose
68 71 format-variant repo config default
69 72 fncache: yes yes yes
70 73 dotencode: yes yes yes
71 74 generaldelta: yes yes yes
72 75 share-safe: no no no
73 76 sparserevlog: yes yes yes
74 77 persistent-nodemap: no no no
75 78 copies-sdc: no no no
76 79 revlog-v2: no no no
77 80 plain-cl-delta: yes yes yes
78 81 compression: zlib zlib zlib
79 82 compression-level: default default default
80 83 $ hg debugformat --verbose --config format.usefncache=no
81 84 format-variant repo config default
82 85 fncache: yes no yes
83 86 dotencode: yes no yes
84 87 generaldelta: yes yes yes
85 88 share-safe: no no no
86 89 sparserevlog: yes yes yes
87 90 persistent-nodemap: no no no
88 91 copies-sdc: no no no
89 92 revlog-v2: no no no
90 93 plain-cl-delta: yes yes yes
91 94 compression: zlib zlib zlib
92 95 compression-level: default default default
93 96 $ hg debugformat --verbose --config format.usefncache=no --color=debug
94 97 format-variant repo config default
95 98 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
96 99 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
97 100 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
98 101 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
99 102 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
100 103 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
101 104 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
102 105 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
103 106 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
104 107 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
105 108 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
106 109 $ hg debugformat -Tjson
107 110 [
108 111 {
109 112 "config": true,
110 113 "default": true,
111 114 "name": "fncache",
112 115 "repo": true
113 116 },
114 117 {
115 118 "config": true,
116 119 "default": true,
117 120 "name": "dotencode",
118 121 "repo": true
119 122 },
120 123 {
121 124 "config": true,
122 125 "default": true,
123 126 "name": "generaldelta",
124 127 "repo": true
125 128 },
126 129 {
127 130 "config": false,
128 131 "default": false,
129 132 "name": "share-safe",
130 133 "repo": false
131 134 },
132 135 {
133 136 "config": true,
134 137 "default": true,
135 138 "name": "sparserevlog",
136 139 "repo": true
137 140 },
138 141 {
139 142 "config": false,
140 143 "default": false,
141 144 "name": "persistent-nodemap",
142 145 "repo": false
143 146 },
144 147 {
145 148 "config": false,
146 149 "default": false,
147 150 "name": "copies-sdc",
148 151 "repo": false
149 152 },
150 153 {
151 154 "config": false,
152 155 "default": false,
153 156 "name": "revlog-v2",
154 157 "repo": false
155 158 },
156 159 {
157 160 "config": true,
158 161 "default": true,
159 162 "name": "plain-cl-delta",
160 163 "repo": true
161 164 },
162 165 {
163 166 "config": "zlib",
164 167 "default": "zlib",
165 168 "name": "compression",
166 169 "repo": "zlib"
167 170 },
168 171 {
169 172 "config": "default",
170 173 "default": "default",
171 174 "name": "compression-level",
172 175 "repo": "default"
173 176 }
174 177 ]
175 178 $ hg debugupgraderepo
176 179 (no format upgrades found in existing repository)
177 180 performing an upgrade with "--run" will make the following changes:
178 181
179 182 requirements
180 183 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
181 184
182 185 processed revlogs:
183 186 - all-filelogs
184 187 - changelog
185 188 - manifest
186 189
187 190 additional optimizations are available by specifying "--optimize <name>":
188 191
189 192 re-delta-parent
190 193 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
191 194
192 195 re-delta-multibase
193 196 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
194 197
195 198 re-delta-all
196 199 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
197 200
198 201 re-delta-fulladd
199 202 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.
200 203
201 204
202 205 $ hg debugupgraderepo --quiet
203 206 requirements
204 207 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
205 208
206 209 processed revlogs:
207 210 - all-filelogs
208 211 - changelog
209 212 - manifest
210 213
211 214
212 215 --optimize can be used to add optimizations
213 216
214 217 $ hg debugupgrade --optimize 're-delta-parent'
215 218 (no format upgrades found in existing repository)
216 219 performing an upgrade with "--run" will make the following changes:
217 220
218 221 requirements
219 222 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
220 223
221 224 optimisations: re-delta-parent
222 225
223 226 re-delta-parent
224 227 deltas within internal storage will choose a new base revision if needed
225 228
226 229 processed revlogs:
227 230 - all-filelogs
228 231 - changelog
229 232 - manifest
230 233
231 234 additional optimizations are available by specifying "--optimize <name>":
232 235
233 236 re-delta-multibase
234 237 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
235 238
236 239 re-delta-all
237 240 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
238 241
239 242 re-delta-fulladd
240 243 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.
241 244
242 245
243 246 modern form of the option
244 247
245 248 $ hg debugupgrade --optimize re-delta-parent
246 249 (no format upgrades found in existing repository)
247 250 performing an upgrade with "--run" will make the following changes:
248 251
249 252 requirements
250 253 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
251 254
252 255 optimisations: re-delta-parent
253 256
254 257 re-delta-parent
255 258 deltas within internal storage will choose a new base revision if needed
256 259
257 260 processed revlogs:
258 261 - all-filelogs
259 262 - changelog
260 263 - manifest
261 264
262 265 additional optimizations are available by specifying "--optimize <name>":
263 266
264 267 re-delta-multibase
265 268 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
266 269
267 270 re-delta-all
268 271 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
269 272
270 273 re-delta-fulladd
271 274 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.
272 275
273 276 $ hg debugupgrade --optimize re-delta-parent --quiet
274 277 requirements
275 278 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
276 279
277 280 optimisations: re-delta-parent
278 281
279 282 processed revlogs:
280 283 - all-filelogs
281 284 - changelog
282 285 - manifest
283 286
284 287
285 288 unknown optimization:
286 289
287 290 $ hg debugupgrade --optimize foobar
288 291 abort: unknown optimization action requested: foobar
289 292 (run without arguments to see valid optimizations)
290 293 [255]
291 294
292 295 Various sub-optimal detections work
293 296
294 297 $ cat > .hg/requires << EOF
295 298 > revlogv1
296 299 > store
297 300 > EOF
298 301
299 302 $ hg debugformat
300 303 format-variant repo
301 304 fncache: no
302 305 dotencode: no
303 306 generaldelta: no
304 307 share-safe: no
305 308 sparserevlog: no
306 309 persistent-nodemap: no
307 310 copies-sdc: no
308 311 revlog-v2: no
309 312 plain-cl-delta: yes
310 313 compression: zlib
311 314 compression-level: default
312 315 $ hg debugformat --verbose
313 316 format-variant repo config default
314 317 fncache: no yes yes
315 318 dotencode: no yes yes
316 319 generaldelta: no yes yes
317 320 share-safe: no no no
318 321 sparserevlog: no yes yes
319 322 persistent-nodemap: no no no
320 323 copies-sdc: no no no
321 324 revlog-v2: no no no
322 325 plain-cl-delta: yes yes yes
323 326 compression: zlib zlib zlib
324 327 compression-level: default default default
325 328 $ hg debugformat --verbose --config format.usegeneraldelta=no
326 329 format-variant repo config default
327 330 fncache: no yes yes
328 331 dotencode: no yes yes
329 332 generaldelta: no no yes
330 333 share-safe: no no no
331 334 sparserevlog: no no yes
332 335 persistent-nodemap: no no no
333 336 copies-sdc: no no no
334 337 revlog-v2: no no no
335 338 plain-cl-delta: yes yes yes
336 339 compression: zlib zlib zlib
337 340 compression-level: default default default
338 341 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
339 342 format-variant repo config default
340 343 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
341 344 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
342 345 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
343 346 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
344 347 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
345 348 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
346 349 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
347 350 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
348 351 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
349 352 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
350 353 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
351 354 $ hg debugupgraderepo
352 355 repository lacks features recommended by current config options:
353 356
354 357 fncache
355 358 long and reserved filenames may not work correctly; repository performance is sub-optimal
356 359
357 360 dotencode
358 361 storage of filenames beginning with a period or space may not work correctly
359 362
360 363 generaldelta
361 364 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
362 365
363 366 sparserevlog
364 367 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.
365 368
366 369
367 370 performing an upgrade with "--run" will make the following changes:
368 371
369 372 requirements
370 373 preserved: revlogv1, store
371 374 added: dotencode, fncache, generaldelta, sparserevlog
372 375
373 376 fncache
374 377 repository will be more resilient to storing certain paths and performance of certain operations should be improved
375 378
376 379 dotencode
377 380 repository will be better able to store files beginning with a space or period
378 381
379 382 generaldelta
380 383 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
381 384
382 385 sparserevlog
383 386 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.
384 387
385 388 processed revlogs:
386 389 - all-filelogs
387 390 - changelog
388 391 - manifest
389 392
390 393 additional optimizations are available by specifying "--optimize <name>":
391 394
392 395 re-delta-parent
393 396 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
394 397
395 398 re-delta-multibase
396 399 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
397 400
398 401 re-delta-all
399 402 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
400 403
401 404 re-delta-fulladd
402 405 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.
403 406
404 407 $ hg debugupgraderepo --quiet
405 408 requirements
406 409 preserved: revlogv1, store
407 410 added: dotencode, fncache, generaldelta, sparserevlog
408 411
409 412 processed revlogs:
410 413 - all-filelogs
411 414 - changelog
412 415 - manifest
413 416
414 417
415 418 $ hg --config format.dotencode=false debugupgraderepo
416 419 repository lacks features recommended by current config options:
417 420
418 421 fncache
419 422 long and reserved filenames may not work correctly; repository performance is sub-optimal
420 423
421 424 generaldelta
422 425 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
423 426
424 427 sparserevlog
425 428 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.
426 429
427 430 repository lacks features used by the default config options:
428 431
429 432 dotencode
430 433 storage of filenames beginning with a period or space may not work correctly
431 434
432 435
433 436 performing an upgrade with "--run" will make the following changes:
434 437
435 438 requirements
436 439 preserved: revlogv1, store
437 440 added: fncache, generaldelta, sparserevlog
438 441
439 442 fncache
440 443 repository will be more resilient to storing certain paths and performance of certain operations should be improved
441 444
442 445 generaldelta
443 446 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
444 447
445 448 sparserevlog
446 449 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.
447 450
448 451 processed revlogs:
449 452 - all-filelogs
450 453 - changelog
451 454 - manifest
452 455
453 456 additional optimizations are available by specifying "--optimize <name>":
454 457
455 458 re-delta-parent
456 459 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
457 460
458 461 re-delta-multibase
459 462 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
460 463
461 464 re-delta-all
462 465 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
463 466
464 467 re-delta-fulladd
465 468 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.
466 469
467 470
468 471 $ cd ..
469 472
470 473 Upgrading a repository that is already modern essentially no-ops
471 474
472 475 $ hg init modern
473 476 $ hg -R modern debugupgraderepo --run
474 477 nothing to do
475 478
476 479 Upgrading a repository to generaldelta works
477 480
478 481 $ hg --config format.usegeneraldelta=false init upgradegd
479 482 $ cd upgradegd
480 483 $ touch f0
481 484 $ hg -q commit -A -m initial
482 485 $ mkdir FooBarDirectory.d
483 486 $ touch FooBarDirectory.d/f1
484 487 $ hg -q commit -A -m 'add f1'
485 488 $ hg -q up -r 0
486 489 >>> from __future__ import absolute_import, print_function
487 490 >>> import random
488 491 >>> random.seed(0) # have a reproducible content
489 492 >>> with open("f2", "wb") as f:
490 493 ... for i in range(100000):
491 494 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
492 495 $ hg -q commit -A -m 'add f2'
493 496
494 497 make sure we have a .d file
495 498
496 499 $ ls -d .hg/store/data/*
497 500 .hg/store/data/_foo_bar_directory.d.hg
498 501 .hg/store/data/f0.i
499 502 .hg/store/data/f2.d
500 503 .hg/store/data/f2.i
501 504
502 505 $ hg debugupgraderepo --run --config format.sparse-revlog=false
503 506 upgrade will perform the following actions:
504 507
505 508 requirements
506 509 preserved: dotencode, fncache, revlogv1, store
507 510 added: generaldelta
508 511
509 512 generaldelta
510 513 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
511 514
512 515 processed revlogs:
513 516 - all-filelogs
514 517 - changelog
515 518 - manifest
516 519
517 520 beginning upgrade...
518 521 repository locked and read-only
519 522 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
520 523 (it is safe to interrupt this process any time before data migration completes)
521 524 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
522 525 migrating 519 KB in store; 1.05 MB tracked data
523 526 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
524 527 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
525 528 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
526 529 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
527 530 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
528 531 finished migrating 3 changelog revisions; change in size: 0 bytes
529 532 finished migrating 9 total revisions; total change in store size: -17 bytes
530 533 copying phaseroots
531 534 data fully upgraded in a temporary repository
532 535 marking source repository as being upgraded; clients will be unable to read from repository
533 536 starting in-place swap of repository data
534 537 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
535 538 replacing store...
536 539 store replacement complete; repository was inconsistent for *s (glob)
537 540 finalizing requirements file and making repository readable again
538 541 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
539 542 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
540 543 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
541 544
542 545 Original requirements backed up
543 546
544 547 $ cat .hg/upgradebackup.*/requires
545 548 dotencode
546 549 fncache
547 550 revlogv1
548 551 store
549 552
550 553 generaldelta added to original requirements files
551 554
552 555 $ cat .hg/requires
553 556 dotencode
554 557 fncache
555 558 generaldelta
556 559 revlogv1
557 560 store
558 561
559 562 store directory has files we expect
560 563
561 564 $ ls .hg/store
562 565 00changelog.i
563 566 00manifest.i
564 567 data
565 568 fncache
566 569 phaseroots
567 570 undo
568 571 undo.backupfiles
569 572 undo.phaseroots
570 573
571 574 manifest should be generaldelta
572 575
573 576 $ hg debugrevlog -m | grep flags
574 577 flags : inline, generaldelta
575 578
576 579 verify should be happy
577 580
578 581 $ hg verify
579 582 checking changesets
580 583 checking manifests
581 584 crosschecking files in changesets and manifests
582 585 checking files
583 586 checked 3 changesets with 3 changes to 3 files
584 587
585 588 old store should be backed up
586 589
587 590 $ ls -d .hg/upgradebackup.*/
588 591 .hg/upgradebackup.*/ (glob)
589 592 $ ls .hg/upgradebackup.*/store
590 593 00changelog.i
591 594 00manifest.i
592 595 data
593 596 fncache
594 597 phaseroots
595 598 undo
596 599 undo.backup.fncache
597 600 undo.backupfiles
598 601 undo.phaseroots
599 602
600 603 unless --no-backup is passed
601 604
602 605 $ rm -rf .hg/upgradebackup.*/
603 606 $ hg debugupgraderepo --run --no-backup
604 607 upgrade will perform the following actions:
605 608
606 609 requirements
607 610 preserved: dotencode, fncache, generaldelta, revlogv1, store
608 611 added: sparserevlog
609 612
610 613 sparserevlog
611 614 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.
612 615
613 616 processed revlogs:
614 617 - all-filelogs
615 618 - changelog
616 619 - manifest
617 620
618 621 beginning upgrade...
619 622 repository locked and read-only
620 623 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
621 624 (it is safe to interrupt this process any time before data migration completes)
622 625 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
623 626 migrating 519 KB in store; 1.05 MB tracked data
624 627 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
625 628 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
626 629 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
627 630 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
628 631 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
629 632 finished migrating 3 changelog revisions; change in size: 0 bytes
630 633 finished migrating 9 total revisions; total change in store size: 0 bytes
631 634 copying phaseroots
632 635 data fully upgraded in a temporary repository
633 636 marking source repository as being upgraded; clients will be unable to read from repository
634 637 starting in-place swap of repository data
635 638 replacing store...
636 639 store replacement complete; repository was inconsistent for * (glob)
637 640 finalizing requirements file and making repository readable again
638 641 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
639 642 $ ls -1 .hg/ | grep upgradebackup
640 643 [1]
641 644
642 645 We can restrict optimization to some revlog:
643 646
644 647 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
645 648 upgrade will perform the following actions:
646 649
647 650 requirements
648 651 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
649 652
650 653 optimisations: re-delta-parent
651 654
652 655 re-delta-parent
653 656 deltas within internal storage will choose a new base revision if needed
654 657
655 658 processed revlogs:
656 659 - manifest
657 660
658 661 beginning upgrade...
659 662 repository locked and read-only
660 663 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
661 664 (it is safe to interrupt this process any time before data migration completes)
662 665 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
663 666 migrating 519 KB in store; 1.05 MB tracked data
664 667 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
665 668 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
666 669 blindly copying data/f0.i containing 1 revisions
667 670 blindly copying data/f2.i containing 1 revisions
668 671 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
669 672 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
670 673 cloning 3 revisions from 00manifest.i
671 674 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
672 675 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
673 676 blindly copying 00changelog.i containing 3 revisions
674 677 finished migrating 3 changelog revisions; change in size: 0 bytes
675 678 finished migrating 9 total revisions; total change in store size: 0 bytes
676 679 copying phaseroots
677 680 data fully upgraded in a temporary repository
678 681 marking source repository as being upgraded; clients will be unable to read from repository
679 682 starting in-place swap of repository data
680 683 replacing store...
681 684 store replacement complete; repository was inconsistent for *s (glob)
682 685 finalizing requirements file and making repository readable again
683 686 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
684 687
685 688 Check that the repo still works fine
686 689
687 690 $ hg log -G --stat
688 691 @ changeset: 2:76d4395f5413 (no-py3 !)
689 692 @ changeset: 2:fca376863211 (py3 !)
690 693 | tag: tip
691 694 | parent: 0:ba592bf28da2
692 695 | user: test
693 696 | date: Thu Jan 01 00:00:00 1970 +0000
694 697 | summary: add f2
695 698 |
696 699 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
697 700 | 1 files changed, 100000 insertions(+), 0 deletions(-)
698 701 |
699 702 | o changeset: 1:2029ce2354e2
700 703 |/ user: test
701 704 | date: Thu Jan 01 00:00:00 1970 +0000
702 705 | summary: add f1
703 706 |
704 707 |
705 708 o changeset: 0:ba592bf28da2
706 709 user: test
707 710 date: Thu Jan 01 00:00:00 1970 +0000
708 711 summary: initial
709 712
710 713
711 714
712 715 $ hg verify
713 716 checking changesets
714 717 checking manifests
715 718 crosschecking files in changesets and manifests
716 719 checking files
717 720 checked 3 changesets with 3 changes to 3 files
718 721
719 722 Check we can select negatively
720 723
721 724 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
722 725 upgrade will perform the following actions:
723 726
724 727 requirements
725 728 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
726 729
727 730 optimisations: re-delta-parent
728 731
729 732 re-delta-parent
730 733 deltas within internal storage will choose a new base revision if needed
731 734
732 735 processed revlogs:
733 736 - all-filelogs
734 737 - changelog
735 738
736 739 beginning upgrade...
737 740 repository locked and read-only
738 741 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
739 742 (it is safe to interrupt this process any time before data migration completes)
740 743 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
741 744 migrating 519 KB in store; 1.05 MB tracked data
742 745 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
743 746 cloning 1 revisions from data/FooBarDirectory.d/f1.i
744 747 cloning 1 revisions from data/f0.i
745 748 cloning 1 revisions from data/f2.i
746 749 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
747 750 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
748 751 blindly copying 00manifest.i containing 3 revisions
749 752 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
750 753 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
751 754 cloning 3 revisions from 00changelog.i
752 755 finished migrating 3 changelog revisions; change in size: 0 bytes
753 756 finished migrating 9 total revisions; total change in store size: 0 bytes
754 757 copying phaseroots
755 758 data fully upgraded in a temporary repository
756 759 marking source repository as being upgraded; clients will be unable to read from repository
757 760 starting in-place swap of repository data
758 761 replacing store...
759 762 store replacement complete; repository was inconsistent for *s (glob)
760 763 finalizing requirements file and making repository readable again
761 764 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
762 765 $ hg verify
763 766 checking changesets
764 767 checking manifests
765 768 crosschecking files in changesets and manifests
766 769 checking files
767 770 checked 3 changesets with 3 changes to 3 files
768 771
769 772 Check that we can select changelog only
770 773
771 774 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
772 775 upgrade will perform the following actions:
773 776
774 777 requirements
775 778 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
776 779
777 780 optimisations: re-delta-parent
778 781
779 782 re-delta-parent
780 783 deltas within internal storage will choose a new base revision if needed
781 784
782 785 processed revlogs:
783 786 - changelog
784 787
785 788 beginning upgrade...
786 789 repository locked and read-only
787 790 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
788 791 (it is safe to interrupt this process any time before data migration completes)
789 792 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
790 793 migrating 519 KB in store; 1.05 MB tracked data
791 794 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
792 795 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
793 796 blindly copying data/f0.i containing 1 revisions
794 797 blindly copying data/f2.i containing 1 revisions
795 798 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
796 799 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
797 800 blindly copying 00manifest.i containing 3 revisions
798 801 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
799 802 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
800 803 cloning 3 revisions from 00changelog.i
801 804 finished migrating 3 changelog revisions; change in size: 0 bytes
802 805 finished migrating 9 total revisions; total change in store size: 0 bytes
803 806 copying phaseroots
804 807 data fully upgraded in a temporary repository
805 808 marking source repository as being upgraded; clients will be unable to read from repository
806 809 starting in-place swap of repository data
807 810 replacing store...
808 811 store replacement complete; repository was inconsistent for *s (glob)
809 812 finalizing requirements file and making repository readable again
810 813 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
811 814 $ hg verify
812 815 checking changesets
813 816 checking manifests
814 817 crosschecking files in changesets and manifests
815 818 checking files
816 819 checked 3 changesets with 3 changes to 3 files
817 820
818 821 Check that we can select filelog only
819 822
820 823 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
821 824 upgrade will perform the following actions:
822 825
823 826 requirements
824 827 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
825 828
826 829 optimisations: re-delta-parent
827 830
828 831 re-delta-parent
829 832 deltas within internal storage will choose a new base revision if needed
830 833
831 834 processed revlogs:
832 835 - all-filelogs
833 836
834 837 beginning upgrade...
835 838 repository locked and read-only
836 839 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
837 840 (it is safe to interrupt this process any time before data migration completes)
838 841 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
839 842 migrating 519 KB in store; 1.05 MB tracked data
840 843 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
841 844 cloning 1 revisions from data/FooBarDirectory.d/f1.i
842 845 cloning 1 revisions from data/f0.i
843 846 cloning 1 revisions from data/f2.i
844 847 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
845 848 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
846 849 blindly copying 00manifest.i containing 3 revisions
847 850 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
848 851 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
849 852 blindly copying 00changelog.i containing 3 revisions
850 853 finished migrating 3 changelog revisions; change in size: 0 bytes
851 854 finished migrating 9 total revisions; total change in store size: 0 bytes
852 855 copying phaseroots
853 856 data fully upgraded in a temporary repository
854 857 marking source repository as being upgraded; clients will be unable to read from repository
855 858 starting in-place swap of repository data
856 859 replacing store...
857 860 store replacement complete; repository was inconsistent for *s (glob)
858 861 finalizing requirements file and making repository readable again
859 862 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
860 863 $ hg verify
861 864 checking changesets
862 865 checking manifests
863 866 crosschecking files in changesets and manifests
864 867 checking files
865 868 checked 3 changesets with 3 changes to 3 files
866 869
867 870
868 871 Check you can't skip revlog clone during important format downgrade
869 872
870 873 $ echo "[format]" > .hg/hgrc
871 874 $ echo "sparse-revlog=no" >> .hg/hgrc
872 875 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
873 876 ignoring revlogs selection flags, format requirements change: sparserevlog
874 877 upgrade will perform the following actions:
875 878
876 879 requirements
877 880 preserved: dotencode, fncache, generaldelta, revlogv1, store
878 881 removed: sparserevlog
879 882
880 883 optimisations: re-delta-parent
881 884
882 885 re-delta-parent
883 886 deltas within internal storage will choose a new base revision if needed
884 887
885 888 processed revlogs:
886 889 - all-filelogs
887 890 - changelog
888 891 - manifest
889 892
890 893 beginning upgrade...
891 894 repository locked and read-only
892 895 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
893 896 (it is safe to interrupt this process any time before data migration completes)
894 897 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
895 898 migrating 519 KB in store; 1.05 MB tracked data
896 899 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
897 900 cloning 1 revisions from data/FooBarDirectory.d/f1.i
898 901 cloning 1 revisions from data/f0.i
899 902 cloning 1 revisions from data/f2.i
900 903 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
901 904 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
902 905 cloning 3 revisions from 00manifest.i
903 906 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
904 907 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
905 908 cloning 3 revisions from 00changelog.i
906 909 finished migrating 3 changelog revisions; change in size: 0 bytes
907 910 finished migrating 9 total revisions; total change in store size: 0 bytes
908 911 copying phaseroots
909 912 data fully upgraded in a temporary repository
910 913 marking source repository as being upgraded; clients will be unable to read from repository
911 914 starting in-place swap of repository data
912 915 replacing store...
913 916 store replacement complete; repository was inconsistent for *s (glob)
914 917 finalizing requirements file and making repository readable again
915 918 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
916 919 $ hg verify
917 920 checking changesets
918 921 checking manifests
919 922 crosschecking files in changesets and manifests
920 923 checking files
921 924 checked 3 changesets with 3 changes to 3 files
922 925
923 926 Check you can't skip revlog clone during important format upgrade
924 927
925 928 $ echo "sparse-revlog=yes" >> .hg/hgrc
926 929 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
927 930 ignoring revlogs selection flags, format requirements change: sparserevlog
928 931 upgrade will perform the following actions:
929 932
930 933 requirements
931 934 preserved: dotencode, fncache, generaldelta, revlogv1, store
932 935 added: sparserevlog
933 936
934 937 optimisations: re-delta-parent
935 938
936 939 sparserevlog
937 940 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.
938 941
939 942 re-delta-parent
940 943 deltas within internal storage will choose a new base revision if needed
941 944
942 945 processed revlogs:
943 946 - all-filelogs
944 947 - changelog
945 948 - manifest
946 949
947 950 beginning upgrade...
948 951 repository locked and read-only
949 952 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
950 953 (it is safe to interrupt this process any time before data migration completes)
951 954 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
952 955 migrating 519 KB in store; 1.05 MB tracked data
953 956 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
954 957 cloning 1 revisions from data/FooBarDirectory.d/f1.i
955 958 cloning 1 revisions from data/f0.i
956 959 cloning 1 revisions from data/f2.i
957 960 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
958 961 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
959 962 cloning 3 revisions from 00manifest.i
960 963 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
961 964 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
962 965 cloning 3 revisions from 00changelog.i
963 966 finished migrating 3 changelog revisions; change in size: 0 bytes
964 967 finished migrating 9 total revisions; total change in store size: 0 bytes
965 968 copying phaseroots
966 969 data fully upgraded in a temporary repository
967 970 marking source repository as being upgraded; clients will be unable to read from repository
968 971 starting in-place swap of repository data
969 972 replacing store...
970 973 store replacement complete; repository was inconsistent for *s (glob)
971 974 finalizing requirements file and making repository readable again
972 975 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
973 976 $ hg verify
974 977 checking changesets
975 978 checking manifests
976 979 crosschecking files in changesets and manifests
977 980 checking files
978 981 checked 3 changesets with 3 changes to 3 files
979 982
980 983 $ cd ..
981 984
982 985 store files with special filenames aren't encoded during copy
983 986
984 987 $ hg init store-filenames
985 988 $ cd store-filenames
986 989 $ touch foo
987 990 $ hg -q commit -A -m initial
988 991 $ touch .hg/store/.XX_special_filename
989 992
990 993 $ hg debugupgraderepo --run
991 994 nothing to do
992 995 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
993 996 upgrade will perform the following actions:
994 997
995 998 requirements
996 999 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
997 1000
998 1001 optimisations: re-delta-fulladd
999 1002
1000 1003 re-delta-fulladd
1001 1004 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
1002 1005
1003 1006 processed revlogs:
1004 1007 - all-filelogs
1005 1008 - changelog
1006 1009 - manifest
1007 1010
1008 1011 beginning upgrade...
1009 1012 repository locked and read-only
1010 1013 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1011 1014 (it is safe to interrupt this process any time before data migration completes)
1012 1015 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1013 1016 migrating 301 bytes in store; 107 bytes tracked data
1014 1017 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1015 1018 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1016 1019 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1017 1020 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1018 1021 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1019 1022 finished migrating 1 changelog revisions; change in size: 0 bytes
1020 1023 finished migrating 3 total revisions; total change in store size: 0 bytes
1021 1024 copying .XX_special_filename
1022 1025 copying phaseroots
1023 1026 data fully upgraded in a temporary repository
1024 1027 marking source repository as being upgraded; clients will be unable to read from repository
1025 1028 starting in-place swap of repository data
1026 1029 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1027 1030 replacing store...
1028 1031 store replacement complete; repository was inconsistent for *s (glob)
1029 1032 finalizing requirements file and making repository readable again
1030 1033 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1031 1034 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1032 1035 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1033 1036
1034 1037 fncache is valid after upgrade
1035 1038
1036 1039 $ hg debugrebuildfncache
1037 1040 fncache already up to date
1038 1041
1039 1042 $ cd ..
1040 1043
1041 1044 Check upgrading a large file repository
1042 1045 ---------------------------------------
1043 1046
1044 1047 $ hg init largefilesrepo
1045 1048 $ cat << EOF >> largefilesrepo/.hg/hgrc
1046 1049 > [extensions]
1047 1050 > largefiles =
1048 1051 > EOF
1049 1052
1050 1053 $ cd largefilesrepo
1051 1054 $ touch foo
1052 1055 $ hg add --large foo
1053 1056 $ hg -q commit -m initial
1054 1057 $ cat .hg/requires
1055 1058 dotencode
1056 1059 fncache
1057 1060 generaldelta
1058 1061 largefiles
1059 1062 revlogv1
1060 1063 sparserevlog
1061 1064 store
1062 1065
1063 1066 $ hg debugupgraderepo --run
1064 1067 nothing to do
1065 1068 $ cat .hg/requires
1066 1069 dotencode
1067 1070 fncache
1068 1071 generaldelta
1069 1072 largefiles
1070 1073 revlogv1
1071 1074 sparserevlog
1072 1075 store
1073 1076
1074 1077 $ cat << EOF >> .hg/hgrc
1075 1078 > [extensions]
1076 1079 > lfs =
1077 1080 > [lfs]
1078 1081 > threshold = 10
1079 1082 > EOF
1080 1083 $ echo '123456789012345' > lfs.bin
1081 1084 $ hg ci -Am 'lfs.bin'
1082 1085 adding lfs.bin
1083 1086 $ grep lfs .hg/requires
1084 1087 lfs
1085 1088 $ find .hg/store/lfs -type f
1086 1089 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1087 1090
1088 1091 $ hg debugupgraderepo --run
1089 1092 nothing to do
1090 1093
1091 1094 $ grep lfs .hg/requires
1092 1095 lfs
1093 1096 $ find .hg/store/lfs -type f
1094 1097 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1095 1098 $ hg verify
1096 1099 checking changesets
1097 1100 checking manifests
1098 1101 crosschecking files in changesets and manifests
1099 1102 checking files
1100 1103 checked 2 changesets with 2 changes to 2 files
1101 1104 $ hg debugdata lfs.bin 0
1102 1105 version https://git-lfs.github.com/spec/v1
1103 1106 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1104 1107 size 16
1105 1108 x-is-binary 0
1106 1109
1107 1110 $ cd ..
1108 1111
1109 1112 repository config is taken in account
1110 1113 -------------------------------------
1111 1114
1112 1115 $ cat << EOF >> $HGRCPATH
1113 1116 > [format]
1114 1117 > maxchainlen = 1
1115 1118 > EOF
1116 1119
1117 1120 $ hg init localconfig
1118 1121 $ cd localconfig
1119 1122 $ cat << EOF > file
1120 1123 > some content
1121 1124 > with some length
1122 1125 > to make sure we get a delta
1123 1126 > after changes
1124 1127 > very long
1125 1128 > very long
1126 1129 > very long
1127 1130 > very long
1128 1131 > very long
1129 1132 > very long
1130 1133 > very long
1131 1134 > very long
1132 1135 > very long
1133 1136 > very long
1134 1137 > very long
1135 1138 > EOF
1136 1139 $ hg -q commit -A -m A
1137 1140 $ echo "new line" >> file
1138 1141 $ hg -q commit -m B
1139 1142 $ echo "new line" >> file
1140 1143 $ hg -q commit -m C
1141 1144
1142 1145 $ cat << EOF >> .hg/hgrc
1143 1146 > [format]
1144 1147 > maxchainlen = 9001
1145 1148 > EOF
1146 1149 $ hg config format
1150 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1147 1151 format.maxchainlen=9001
1148 1152 $ hg debugdeltachain file
1149 1153 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1150 1154 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1151 1155 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1152 1156 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1153 1157
1154 1158 $ hg debugupgraderepo --run --optimize 're-delta-all'
1155 1159 upgrade will perform the following actions:
1156 1160
1157 1161 requirements
1158 1162 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1159 1163
1160 1164 optimisations: re-delta-all
1161 1165
1162 1166 re-delta-all
1163 1167 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1164 1168
1165 1169 processed revlogs:
1166 1170 - all-filelogs
1167 1171 - changelog
1168 1172 - manifest
1169 1173
1170 1174 beginning upgrade...
1171 1175 repository locked and read-only
1172 1176 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1173 1177 (it is safe to interrupt this process any time before data migration completes)
1174 1178 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1175 1179 migrating 1019 bytes in store; 882 bytes tracked data
1176 1180 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1177 1181 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1178 1182 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1179 1183 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1180 1184 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1181 1185 finished migrating 3 changelog revisions; change in size: 0 bytes
1182 1186 finished migrating 9 total revisions; total change in store size: -9 bytes
1183 1187 copying phaseroots
1184 1188 data fully upgraded in a temporary repository
1185 1189 marking source repository as being upgraded; clients will be unable to read from repository
1186 1190 starting in-place swap of repository data
1187 1191 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1188 1192 replacing store...
1189 1193 store replacement complete; repository was inconsistent for *s (glob)
1190 1194 finalizing requirements file and making repository readable again
1191 1195 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1192 1196 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1193 1197 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1194 1198 $ hg debugdeltachain file
1195 1199 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1196 1200 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1197 1201 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1198 1202 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1199 1203 $ cd ..
1200 1204
1201 1205 $ cat << EOF >> $HGRCPATH
1202 1206 > [format]
1203 1207 > maxchainlen = 9001
1204 1208 > EOF
1205 1209
1206 1210 Check upgrading a sparse-revlog repository
1207 1211 ---------------------------------------
1208 1212
1209 1213 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1210 1214 $ cd sparserevlogrepo
1211 1215 $ touch foo
1212 1216 $ hg add foo
1213 1217 $ hg -q commit -m "foo"
1214 1218 $ cat .hg/requires
1215 1219 dotencode
1216 1220 fncache
1217 1221 generaldelta
1218 1222 revlogv1
1219 1223 store
1220 1224
1221 1225 Check that we can add the sparse-revlog format requirement
1222 1226 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1223 1227 upgrade will perform the following actions:
1224 1228
1225 1229 requirements
1226 1230 preserved: dotencode, fncache, generaldelta, revlogv1, store
1227 1231 added: sparserevlog
1228 1232
1229 1233 processed revlogs:
1230 1234 - all-filelogs
1231 1235 - changelog
1232 1236 - manifest
1233 1237
1234 1238 $ cat .hg/requires
1235 1239 dotencode
1236 1240 fncache
1237 1241 generaldelta
1238 1242 revlogv1
1239 1243 sparserevlog
1240 1244 store
1241 1245
1242 1246 Check that we can remove the sparse-revlog format requirement
1243 1247 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1244 1248 upgrade will perform the following actions:
1245 1249
1246 1250 requirements
1247 1251 preserved: dotencode, fncache, generaldelta, revlogv1, store
1248 1252 removed: sparserevlog
1249 1253
1250 1254 processed revlogs:
1251 1255 - all-filelogs
1252 1256 - changelog
1253 1257 - manifest
1254 1258
1255 1259 $ cat .hg/requires
1256 1260 dotencode
1257 1261 fncache
1258 1262 generaldelta
1259 1263 revlogv1
1260 1264 store
1261 1265
1262 1266 #if zstd
1263 1267
1264 1268 Check upgrading to a zstd revlog
1265 1269 --------------------------------
1266 1270
1267 1271 upgrade
1268 1272
1269 1273 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1270 1274 upgrade will perform the following actions:
1271 1275
1272 1276 requirements
1273 1277 preserved: dotencode, fncache, generaldelta, revlogv1, store
1274 1278 added: revlog-compression-zstd, sparserevlog
1275 1279
1276 1280 processed revlogs:
1277 1281 - all-filelogs
1278 1282 - changelog
1279 1283 - manifest
1280 1284
1281 1285 $ hg debugformat -v
1282 1286 format-variant repo config default
1283 1287 fncache: yes yes yes
1284 1288 dotencode: yes yes yes
1285 1289 generaldelta: yes yes yes
1286 1290 share-safe: no no no
1287 1291 sparserevlog: yes yes yes
1288 1292 persistent-nodemap: no no no
1289 1293 copies-sdc: no no no
1290 1294 revlog-v2: no no no
1291 1295 plain-cl-delta: yes yes yes
1292 1296 compression: zstd zlib zlib
1293 1297 compression-level: default default default
1294 1298 $ cat .hg/requires
1295 1299 dotencode
1296 1300 fncache
1297 1301 generaldelta
1298 1302 revlog-compression-zstd
1299 1303 revlogv1
1300 1304 sparserevlog
1301 1305 store
1302 1306
1303 1307 downgrade
1304 1308
1305 1309 $ hg debugupgraderepo --run --no-backup --quiet
1306 1310 upgrade will perform the following actions:
1307 1311
1308 1312 requirements
1309 1313 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1310 1314 removed: revlog-compression-zstd
1311 1315
1312 1316 processed revlogs:
1313 1317 - all-filelogs
1314 1318 - changelog
1315 1319 - manifest
1316 1320
1317 1321 $ hg debugformat -v
1318 1322 format-variant repo config default
1319 1323 fncache: yes yes yes
1320 1324 dotencode: yes yes yes
1321 1325 generaldelta: yes yes yes
1322 1326 share-safe: no no no
1323 1327 sparserevlog: yes yes yes
1324 1328 persistent-nodemap: no no no
1325 1329 copies-sdc: no no no
1326 1330 revlog-v2: no no no
1327 1331 plain-cl-delta: yes yes yes
1328 1332 compression: zlib zlib zlib
1329 1333 compression-level: default default default
1330 1334 $ cat .hg/requires
1331 1335 dotencode
1332 1336 fncache
1333 1337 generaldelta
1334 1338 revlogv1
1335 1339 sparserevlog
1336 1340 store
1337 1341
1338 1342 upgrade from hgrc
1339 1343
1340 1344 $ cat >> .hg/hgrc << EOF
1341 1345 > [format]
1342 1346 > revlog-compression=zstd
1343 1347 > EOF
1344 1348 $ hg debugupgraderepo --run --no-backup --quiet
1345 1349 upgrade will perform the following actions:
1346 1350
1347 1351 requirements
1348 1352 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
1349 1353 added: revlog-compression-zstd
1350 1354
1351 1355 processed revlogs:
1352 1356 - all-filelogs
1353 1357 - changelog
1354 1358 - manifest
1355 1359
1356 1360 $ hg debugformat -v
1357 1361 format-variant repo config default
1358 1362 fncache: yes yes yes
1359 1363 dotencode: yes yes yes
1360 1364 generaldelta: yes yes yes
1361 1365 share-safe: no no no
1362 1366 sparserevlog: yes yes yes
1363 1367 persistent-nodemap: no no no
1364 1368 copies-sdc: no no no
1365 1369 revlog-v2: no no no
1366 1370 plain-cl-delta: yes yes yes
1367 1371 compression: zstd zstd zlib
1368 1372 compression-level: default default default
1369 1373 $ cat .hg/requires
1370 1374 dotencode
1371 1375 fncache
1372 1376 generaldelta
1373 1377 revlog-compression-zstd
1374 1378 revlogv1
1375 1379 sparserevlog
1376 1380 store
1377 1381
1378 1382 #endif
1379 1383
1380 1384 Check upgrading to a side-data revlog
1381 1385 -------------------------------------
1382 1386
1383 1387 upgrade
1384 1388
1385 1389 $ hg --config format.exp-use-side-data=yes debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1386 1390 upgrade will perform the following actions:
1387 1391
1388 1392 requirements
1389 1393 preserved: dotencode, fncache, generaldelta, store (no-zstd !)
1390 1394 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd !)
1391 1395 removed: revlogv1
1392 1396 added: exp-revlogv2.2, exp-sidedata-flag (zstd !)
1393 1397 added: exp-revlogv2.2, exp-sidedata-flag, sparserevlog (no-zstd !)
1394 1398
1395 1399 processed revlogs:
1396 1400 - all-filelogs
1397 1401 - changelog
1398 1402 - manifest
1399 1403
1400 1404 $ hg debugformat -v
1401 1405 format-variant repo config default
1402 1406 fncache: yes yes yes
1403 1407 dotencode: yes yes yes
1404 1408 generaldelta: yes yes yes
1405 1409 share-safe: no no no
1406 1410 sparserevlog: yes yes yes
1407 1411 persistent-nodemap: no no no
1408 1412 copies-sdc: no no no
1409 1413 revlog-v2: yes no no
1410 1414 plain-cl-delta: yes yes yes
1411 1415 compression: zlib zlib zlib (no-zstd !)
1412 1416 compression: zstd zstd zlib (zstd !)
1413 1417 compression-level: default default default
1414 1418 $ cat .hg/requires
1415 1419 dotencode
1416 1420 exp-revlogv2.2
1417 1421 exp-sidedata-flag
1418 1422 fncache
1419 1423 generaldelta
1420 1424 revlog-compression-zstd (zstd !)
1421 1425 sparserevlog
1422 1426 store
1423 1427 $ hg debugsidedata -c 0
1424 1428 2 sidedata entries
1425 1429 entry-0001 size 4
1426 1430 entry-0002 size 32
1427 1431
1428 1432 downgrade
1429 1433
1430 1434 $ hg debugupgraderepo --config format.exp-use-side-data=no --run --no-backup --quiet
1431 1435 upgrade will perform the following actions:
1432 1436
1433 1437 requirements
1434 1438 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1435 1439 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd !)
1436 1440 removed: exp-revlogv2.2, exp-sidedata-flag
1437 1441 added: revlogv1
1438 1442
1439 1443 processed revlogs:
1440 1444 - all-filelogs
1441 1445 - changelog
1442 1446 - manifest
1443 1447
1444 1448 $ hg debugformat -v
1445 1449 format-variant repo config default
1446 1450 fncache: yes yes yes
1447 1451 dotencode: yes yes yes
1448 1452 generaldelta: yes yes yes
1449 1453 share-safe: no no no
1450 1454 sparserevlog: yes yes yes
1451 1455 persistent-nodemap: no no no
1452 1456 copies-sdc: no no no
1453 1457 revlog-v2: no no no
1454 1458 plain-cl-delta: yes yes yes
1455 1459 compression: zlib zlib zlib (no-zstd !)
1456 1460 compression: zstd zstd zlib (zstd !)
1457 1461 compression-level: default default default
1458 1462 $ cat .hg/requires
1459 1463 dotencode
1460 1464 fncache
1461 1465 generaldelta
1462 1466 revlog-compression-zstd (zstd !)
1463 1467 revlogv1
1464 1468 sparserevlog
1465 1469 store
1466 1470 $ hg debugsidedata -c 0
1467 1471
1468 1472 upgrade from hgrc
1469 1473
1470 1474 $ cat >> .hg/hgrc << EOF
1471 1475 > [format]
1472 1476 > exp-use-side-data=yes
1473 1477 > EOF
1474 1478 $ hg debugupgraderepo --run --no-backup --quiet
1475 1479 upgrade will perform the following actions:
1476 1480
1477 1481 requirements
1478 1482 preserved: dotencode, fncache, generaldelta, sparserevlog, store (no-zstd !)
1479 1483 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, sparserevlog, store (zstd !)
1480 1484 removed: revlogv1
1481 1485 added: exp-revlogv2.2, exp-sidedata-flag
1482 1486
1483 1487 processed revlogs:
1484 1488 - all-filelogs
1485 1489 - changelog
1486 1490 - manifest
1487 1491
1488 1492 $ hg debugformat -v
1489 1493 format-variant repo config default
1490 1494 fncache: yes yes yes
1491 1495 dotencode: yes yes yes
1492 1496 generaldelta: yes yes yes
1493 1497 share-safe: no no no
1494 1498 sparserevlog: yes yes yes
1495 1499 persistent-nodemap: no no no
1496 1500 copies-sdc: no no no
1497 1501 revlog-v2: yes yes no
1498 1502 plain-cl-delta: yes yes yes
1499 1503 compression: zlib zlib zlib (no-zstd !)
1500 1504 compression: zstd zstd zlib (zstd !)
1501 1505 compression-level: default default default
1502 1506 $ cat .hg/requires
1503 1507 dotencode
1504 1508 exp-revlogv2.2
1505 1509 exp-sidedata-flag
1506 1510 fncache
1507 1511 generaldelta
1508 1512 revlog-compression-zstd (zstd !)
1509 1513 sparserevlog
1510 1514 store
1511 1515 $ hg debugsidedata -c 0
1512 1516
1513 1517 Demonstrate that nothing to perform upgrade will still run all the way through
1514 1518
1515 1519 $ hg debugupgraderepo --run
1516 1520 nothing to do
General Comments 0
You need to be logged in to leave comments. Login now