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