##// END OF EJS Templates
tests: glob seconds in test-upgrade-repo.t...
Pulkit Goyal -
r42157:22ed6386 default
parent child Browse files
Show More
@@ -1,843 +1,843 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 plain-cl-delta: yes
61 61 compression: zlib
62 62 $ hg debugformat --verbose
63 63 format-variant repo config default
64 64 fncache: yes yes yes
65 65 dotencode: yes yes yes
66 66 generaldelta: yes yes yes
67 67 sparserevlog: yes yes yes
68 68 plain-cl-delta: yes yes yes
69 69 compression: zlib zlib zlib
70 70 $ hg debugformat --verbose --config format.usefncache=no
71 71 format-variant repo config default
72 72 fncache: yes no yes
73 73 dotencode: yes no yes
74 74 generaldelta: yes yes yes
75 75 sparserevlog: yes yes yes
76 76 plain-cl-delta: yes yes yes
77 77 compression: zlib zlib zlib
78 78 $ hg debugformat --verbose --config format.usefncache=no --color=debug
79 79 format-variant repo config default
80 80 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
81 81 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
82 82 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
83 83 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
84 84 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
85 85 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
86 86 $ hg debugformat -Tjson
87 87 [
88 88 {
89 89 "config": true,
90 90 "default": true,
91 91 "name": "fncache",
92 92 "repo": true
93 93 },
94 94 {
95 95 "config": true,
96 96 "default": true,
97 97 "name": "dotencode",
98 98 "repo": true
99 99 },
100 100 {
101 101 "config": true,
102 102 "default": true,
103 103 "name": "generaldelta",
104 104 "repo": true
105 105 },
106 106 {
107 107 "config": true,
108 108 "default": true,
109 109 "name": "sparserevlog",
110 110 "repo": true
111 111 },
112 112 {
113 113 "config": true,
114 114 "default": true,
115 115 "name": "plain-cl-delta",
116 116 "repo": true
117 117 },
118 118 {
119 119 "config": "zlib",
120 120 "default": "zlib",
121 121 "name": "compression",
122 122 "repo": "zlib"
123 123 }
124 124 ]
125 125 $ hg debugupgraderepo
126 126 (no feature deficiencies found in existing repository)
127 127 performing an upgrade with "--run" will make the following changes:
128 128
129 129 requirements
130 130 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
131 131
132 132 additional optimizations are available by specifying "--optimize <name>":
133 133
134 134 re-delta-parent
135 135 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
136 136
137 137 re-delta-multibase
138 138 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
139 139
140 140 re-delta-all
141 141 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
142 142
143 143 re-delta-fulladd
144 144 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.
145 145
146 146
147 147 --optimize can be used to add optimizations
148 148
149 149 $ hg debugupgrade --optimize redeltaparent
150 150 (no feature deficiencies found in existing repository)
151 151 performing an upgrade with "--run" will make the following changes:
152 152
153 153 requirements
154 154 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
155 155
156 156 re-delta-parent
157 157 deltas within internal storage will choose a new base revision if needed
158 158
159 159 additional optimizations are available by specifying "--optimize <name>":
160 160
161 161 re-delta-multibase
162 162 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
163 163
164 164 re-delta-all
165 165 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
166 166
167 167 re-delta-fulladd
168 168 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.
169 169
170 170
171 171 modern form of the option
172 172
173 173 $ hg debugupgrade --optimize re-delta-parent
174 174 (no feature deficiencies found in existing repository)
175 175 performing an upgrade with "--run" will make the following changes:
176 176
177 177 requirements
178 178 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
179 179
180 180 re-delta-parent
181 181 deltas within internal storage will choose a new base revision if needed
182 182
183 183 additional optimizations are available by specifying "--optimize <name>":
184 184
185 185 re-delta-multibase
186 186 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
187 187
188 188 re-delta-all
189 189 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
190 190
191 191 re-delta-fulladd
192 192 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.
193 193
194 194
195 195 unknown optimization:
196 196
197 197 $ hg debugupgrade --optimize foobar
198 198 abort: unknown optimization action requested: foobar
199 199 (run without arguments to see valid optimizations)
200 200 [255]
201 201
202 202 Various sub-optimal detections work
203 203
204 204 $ cat > .hg/requires << EOF
205 205 > revlogv1
206 206 > store
207 207 > EOF
208 208
209 209 $ hg debugformat
210 210 format-variant repo
211 211 fncache: no
212 212 dotencode: no
213 213 generaldelta: no
214 214 sparserevlog: no
215 215 plain-cl-delta: yes
216 216 compression: zlib
217 217 $ hg debugformat --verbose
218 218 format-variant repo config default
219 219 fncache: no yes yes
220 220 dotencode: no yes yes
221 221 generaldelta: no yes yes
222 222 sparserevlog: no yes yes
223 223 plain-cl-delta: yes yes yes
224 224 compression: zlib zlib zlib
225 225 $ hg debugformat --verbose --config format.usegeneraldelta=no
226 226 format-variant repo config default
227 227 fncache: no yes yes
228 228 dotencode: no yes yes
229 229 generaldelta: no no yes
230 230 sparserevlog: no no yes
231 231 plain-cl-delta: yes yes yes
232 232 compression: zlib zlib zlib
233 233 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
234 234 format-variant repo config default
235 235 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
236 236 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
237 237 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
238 238 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
239 239 [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
240 240 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib]
241 241 $ hg debugupgraderepo
242 242 repository lacks features recommended by current config options:
243 243
244 244 fncache
245 245 long and reserved filenames may not work correctly; repository performance is sub-optimal
246 246
247 247 dotencode
248 248 storage of filenames beginning with a period or space may not work correctly
249 249
250 250 generaldelta
251 251 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
252 252
253 253 sparserevlog
254 254 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.
255 255
256 256
257 257 performing an upgrade with "--run" will make the following changes:
258 258
259 259 requirements
260 260 preserved: revlogv1, store
261 261 added: dotencode, fncache, generaldelta, sparserevlog
262 262
263 263 fncache
264 264 repository will be more resilient to storing certain paths and performance of certain operations should be improved
265 265
266 266 dotencode
267 267 repository will be better able to store files beginning with a space or period
268 268
269 269 generaldelta
270 270 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
271 271
272 272 sparserevlog
273 273 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.
274 274
275 275 additional optimizations are available by specifying "--optimize <name>":
276 276
277 277 re-delta-parent
278 278 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
279 279
280 280 re-delta-multibase
281 281 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
282 282
283 283 re-delta-all
284 284 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
285 285
286 286 re-delta-fulladd
287 287 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.
288 288
289 289
290 290 $ hg --config format.dotencode=false debugupgraderepo
291 291 repository lacks features recommended by current config options:
292 292
293 293 fncache
294 294 long and reserved filenames may not work correctly; repository performance is sub-optimal
295 295
296 296 generaldelta
297 297 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
298 298
299 299 sparserevlog
300 300 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.
301 301
302 302 repository lacks features used by the default config options:
303 303
304 304 dotencode
305 305 storage of filenames beginning with a period or space may not work correctly
306 306
307 307
308 308 performing an upgrade with "--run" will make the following changes:
309 309
310 310 requirements
311 311 preserved: revlogv1, store
312 312 added: fncache, generaldelta, sparserevlog
313 313
314 314 fncache
315 315 repository will be more resilient to storing certain paths and performance of certain operations should be improved
316 316
317 317 generaldelta
318 318 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
319 319
320 320 sparserevlog
321 321 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.
322 322
323 323 additional optimizations are available by specifying "--optimize <name>":
324 324
325 325 re-delta-parent
326 326 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
327 327
328 328 re-delta-multibase
329 329 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
330 330
331 331 re-delta-all
332 332 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
333 333
334 334 re-delta-fulladd
335 335 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.
336 336
337 337
338 338 $ cd ..
339 339
340 340 Upgrading a repository that is already modern essentially no-ops
341 341
342 342 $ hg init modern
343 343 $ hg -R modern debugupgraderepo --run
344 344 upgrade will perform the following actions:
345 345
346 346 requirements
347 347 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
348 348
349 349 beginning upgrade...
350 350 repository locked and read-only
351 351 creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
352 352 (it is safe to interrupt this process any time before data migration completes)
353 353 data fully migrated to temporary repository
354 354 marking source repository as being upgraded; clients will be unable to read from repository
355 355 starting in-place swap of repository data
356 356 replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
357 357 replacing store...
358 358 store replacement complete; repository was inconsistent for *s (glob)
359 359 finalizing requirements file and making repository readable again
360 360 removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
361 361 copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
362 362 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
363 363
364 364 Upgrading a repository to generaldelta works
365 365
366 366 $ hg --config format.usegeneraldelta=false init upgradegd
367 367 $ cd upgradegd
368 368 $ touch f0
369 369 $ hg -q commit -A -m initial
370 370 $ touch f1
371 371 $ hg -q commit -A -m 'add f1'
372 372 $ hg -q up -r 0
373 373 $ touch f2
374 374 $ hg -q commit -A -m 'add f2'
375 375
376 376 $ hg debugupgraderepo --run --config format.sparse-revlog=false
377 377 upgrade will perform the following actions:
378 378
379 379 requirements
380 380 preserved: dotencode, fncache, revlogv1, store
381 381 added: generaldelta
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 beginning upgrade...
387 387 repository locked and read-only
388 388 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
389 389 (it is safe to interrupt this process any time before data migration completes)
390 390 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
391 391 migrating 917 bytes in store; 401 bytes tracked data
392 392 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
393 393 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
394 394 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
395 395 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
396 396 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
397 397 finished migrating 3 changelog revisions; change in size: 0 bytes
398 398 finished migrating 9 total revisions; total change in store size: 0 bytes
399 399 copying phaseroots
400 400 data fully migrated to temporary repository
401 401 marking source repository as being upgraded; clients will be unable to read from repository
402 402 starting in-place swap of repository data
403 403 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
404 404 replacing store...
405 405 store replacement complete; repository was inconsistent for *s (glob)
406 406 finalizing requirements file and making repository readable again
407 407 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
408 408 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
409 409 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
410 410
411 411 Original requirements backed up
412 412
413 413 $ cat .hg/upgradebackup.*/requires
414 414 dotencode
415 415 fncache
416 416 revlogv1
417 417 store
418 418
419 419 generaldelta added to original requirements files
420 420
421 421 $ cat .hg/requires
422 422 dotencode
423 423 fncache
424 424 generaldelta
425 425 revlogv1
426 426 store
427 427
428 428 store directory has files we expect
429 429
430 430 $ ls .hg/store
431 431 00changelog.i
432 432 00manifest.i
433 433 data
434 434 fncache
435 435 phaseroots
436 436 undo
437 437 undo.backupfiles
438 438 undo.phaseroots
439 439
440 440 manifest should be generaldelta
441 441
442 442 $ hg debugrevlog -m | grep flags
443 443 flags : inline, generaldelta
444 444
445 445 verify should be happy
446 446
447 447 $ hg verify
448 448 checking changesets
449 449 checking manifests
450 450 crosschecking files in changesets and manifests
451 451 checking files
452 452 checked 3 changesets with 3 changes to 3 files
453 453
454 454 old store should be backed up
455 455
456 456 $ ls -d .hg/upgradebackup.*/
457 457 .hg/upgradebackup.*/ (glob)
458 458 $ ls .hg/upgradebackup.*/store
459 459 00changelog.i
460 460 00manifest.i
461 461 data
462 462 fncache
463 463 phaseroots
464 464 undo
465 465 undo.backup.fncache
466 466 undo.backupfiles
467 467 undo.phaseroots
468 468
469 469 unless --no-backup is passed
470 470
471 471 $ rm -rf .hg/upgradebackup.*/
472 472 $ hg debugupgraderepo --run --no-backup
473 473 upgrade will perform the following actions:
474 474
475 475 requirements
476 476 preserved: dotencode, fncache, generaldelta, revlogv1, store
477 477 added: sparserevlog
478 478
479 479 sparserevlog
480 480 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.
481 481
482 482 beginning upgrade...
483 483 repository locked and read-only
484 484 creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
485 485 (it is safe to interrupt this process any time before data migration completes)
486 486 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
487 487 migrating 917 bytes in store; 401 bytes tracked data
488 488 migrating 3 filelogs containing 3 revisions (192 bytes in store; 0 bytes tracked data)
489 489 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
490 490 migrating 1 manifests containing 3 revisions (349 bytes in store; 220 bytes tracked data)
491 491 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
492 492 migrating changelog containing 3 revisions (376 bytes in store; 181 bytes tracked data)
493 493 finished migrating 3 changelog revisions; change in size: 0 bytes
494 494 finished migrating 9 total revisions; total change in store size: 0 bytes
495 495 copying phaseroots
496 496 data fully migrated to temporary repository
497 497 marking source repository as being upgraded; clients will be unable to read from repository
498 498 starting in-place swap of repository data
499 499 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
500 500 replacing store...
501 store replacement complete; repository was inconsistent for 0.0s
501 store replacement complete; repository was inconsistent for * (glob)
502 502 finalizing requirements file and making repository readable again
503 503 removing old repository content$TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
504 504 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
505 505 $ ls -1 .hg/ | grep upgradebackup
506 506 [1]
507 507 $ cd ..
508 508
509 509
510 510 store files with special filenames aren't encoded during copy
511 511
512 512 $ hg init store-filenames
513 513 $ cd store-filenames
514 514 $ touch foo
515 515 $ hg -q commit -A -m initial
516 516 $ touch .hg/store/.XX_special_filename
517 517
518 518 $ hg debugupgraderepo --run
519 519 upgrade will perform the following actions:
520 520
521 521 requirements
522 522 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
523 523
524 524 beginning upgrade...
525 525 repository locked and read-only
526 526 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
527 527 (it is safe to interrupt this process any time before data migration completes)
528 528 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
529 529 migrating 301 bytes in store; 107 bytes tracked data
530 530 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
531 531 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
532 532 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
533 533 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
534 534 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
535 535 finished migrating 1 changelog revisions; change in size: 0 bytes
536 536 finished migrating 3 total revisions; total change in store size: 0 bytes
537 537 copying .XX_special_filename
538 538 copying phaseroots
539 539 data fully migrated to temporary repository
540 540 marking source repository as being upgraded; clients will be unable to read from repository
541 541 starting in-place swap of repository data
542 542 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
543 543 replacing store...
544 544 store replacement complete; repository was inconsistent for *s (glob)
545 545 finalizing requirements file and making repository readable again
546 546 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
547 547 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
548 548 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
549 549 $ hg debugupgraderepo --run --optimize redeltafulladd
550 550 upgrade will perform the following actions:
551 551
552 552 requirements
553 553 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
554 554
555 555 re-delta-fulladd
556 556 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
557 557
558 558 beginning upgrade...
559 559 repository locked and read-only
560 560 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
561 561 (it is safe to interrupt this process any time before data migration completes)
562 562 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
563 563 migrating 301 bytes in store; 107 bytes tracked data
564 564 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
565 565 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
566 566 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
567 567 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
568 568 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
569 569 finished migrating 1 changelog revisions; change in size: 0 bytes
570 570 finished migrating 3 total revisions; total change in store size: 0 bytes
571 571 copying .XX_special_filename
572 572 copying phaseroots
573 573 data fully migrated to temporary repository
574 574 marking source repository as being upgraded; clients will be unable to read from repository
575 575 starting in-place swap of repository data
576 576 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
577 577 replacing store...
578 578 store replacement complete; repository was inconsistent for *s (glob)
579 579 finalizing requirements file and making repository readable again
580 580 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
581 581 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
582 582 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
583 583
584 584 fncache is valid after upgrade
585 585
586 586 $ hg debugrebuildfncache
587 587 fncache already up to date
588 588
589 589 $ cd ..
590 590
591 591 Check upgrading a large file repository
592 592 ---------------------------------------
593 593
594 594 $ hg init largefilesrepo
595 595 $ cat << EOF >> largefilesrepo/.hg/hgrc
596 596 > [extensions]
597 597 > largefiles =
598 598 > EOF
599 599
600 600 $ cd largefilesrepo
601 601 $ touch foo
602 602 $ hg add --large foo
603 603 $ hg -q commit -m initial
604 604 $ cat .hg/requires
605 605 dotencode
606 606 fncache
607 607 generaldelta
608 608 largefiles
609 609 revlogv1
610 610 sparserevlog
611 611 store
612 612
613 613 $ hg debugupgraderepo --run
614 614 upgrade will perform the following actions:
615 615
616 616 requirements
617 617 preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, sparserevlog, store
618 618
619 619 beginning upgrade...
620 620 repository locked and read-only
621 621 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
622 622 (it is safe to interrupt this process any time before data migration completes)
623 623 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
624 624 migrating 355 bytes in store; 160 bytes tracked data
625 625 migrating 1 filelogs containing 1 revisions (106 bytes in store; 41 bytes tracked data)
626 626 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
627 627 migrating 1 manifests containing 1 revisions (116 bytes in store; 51 bytes tracked data)
628 628 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
629 629 migrating changelog containing 1 revisions (133 bytes in store; 68 bytes tracked data)
630 630 finished migrating 1 changelog revisions; change in size: 0 bytes
631 631 finished migrating 3 total revisions; total change in store size: 0 bytes
632 632 copying phaseroots
633 633 data fully migrated to temporary repository
634 634 marking source repository as being upgraded; clients will be unable to read from repository
635 635 starting in-place swap of repository data
636 636 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
637 637 replacing store...
638 638 store replacement complete; repository was inconsistent for *s (glob)
639 639 finalizing requirements file and making repository readable again
640 640 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
641 641 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
642 642 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
643 643 $ cat .hg/requires
644 644 dotencode
645 645 fncache
646 646 generaldelta
647 647 largefiles
648 648 revlogv1
649 649 sparserevlog
650 650 store
651 651
652 652 $ cat << EOF >> .hg/hgrc
653 653 > [extensions]
654 654 > lfs =
655 655 > [lfs]
656 656 > threshold = 10
657 657 > EOF
658 658 $ echo '123456789012345' > lfs.bin
659 659 $ hg ci -Am 'lfs.bin'
660 660 adding lfs.bin
661 661 $ grep lfs .hg/requires
662 662 lfs
663 663 $ find .hg/store/lfs -type f
664 664 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
665 665
666 666 $ hg debugupgraderepo --run
667 667 upgrade will perform the following actions:
668 668
669 669 requirements
670 670 preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, sparserevlog, store
671 671
672 672 beginning upgrade...
673 673 repository locked and read-only
674 674 creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
675 675 (it is safe to interrupt this process any time before data migration completes)
676 676 migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
677 677 migrating 801 bytes in store; 467 bytes tracked data
678 678 migrating 2 filelogs containing 2 revisions (296 bytes in store; 182 bytes tracked data)
679 679 finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
680 680 migrating 1 manifests containing 2 revisions (241 bytes in store; 151 bytes tracked data)
681 681 finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
682 682 migrating changelog containing 2 revisions (264 bytes in store; 134 bytes tracked data)
683 683 finished migrating 2 changelog revisions; change in size: 0 bytes
684 684 finished migrating 6 total revisions; total change in store size: 0 bytes
685 685 copying phaseroots
686 686 copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
687 687 data fully migrated to temporary repository
688 688 marking source repository as being upgraded; clients will be unable to read from repository
689 689 starting in-place swap of repository data
690 690 replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
691 691 replacing store...
692 692 store replacement complete; repository was inconsistent for *s (glob)
693 693 finalizing requirements file and making repository readable again
694 694 removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
695 695 copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
696 696 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
697 697
698 698 $ grep lfs .hg/requires
699 699 lfs
700 700 $ find .hg/store/lfs -type f
701 701 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
702 702 $ hg verify
703 703 checking changesets
704 704 checking manifests
705 705 crosschecking files in changesets and manifests
706 706 checking files
707 707 checked 2 changesets with 2 changes to 2 files
708 708 $ hg debugdata lfs.bin 0
709 709 version https://git-lfs.github.com/spec/v1
710 710 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
711 711 size 16
712 712 x-is-binary 0
713 713
714 714 $ cd ..
715 715
716 716 repository config is taken in account
717 717 -------------------------------------
718 718
719 719 $ cat << EOF >> $HGRCPATH
720 720 > [format]
721 721 > maxchainlen = 1
722 722 > EOF
723 723
724 724 $ hg init localconfig
725 725 $ cd localconfig
726 726 $ cat << EOF > file
727 727 > some content
728 728 > with some length
729 729 > to make sure we get a delta
730 730 > after changes
731 731 > very long
732 732 > very long
733 733 > very long
734 734 > very long
735 735 > very long
736 736 > very long
737 737 > very long
738 738 > very long
739 739 > very long
740 740 > very long
741 741 > very long
742 742 > EOF
743 743 $ hg -q commit -A -m A
744 744 $ echo "new line" >> file
745 745 $ hg -q commit -m B
746 746 $ echo "new line" >> file
747 747 $ hg -q commit -m C
748 748
749 749 $ cat << EOF >> .hg/hgrc
750 750 > [format]
751 751 > maxchainlen = 9001
752 752 > EOF
753 753 $ hg config format
754 754 format.maxchainlen=9001
755 755 $ hg debugdeltachain file
756 756 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
757 757 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
758 758 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
759 759 2 1 2 0 other 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
760 760
761 761 $ hg debugupgraderepo --run --optimize redeltaall
762 762 upgrade will perform the following actions:
763 763
764 764 requirements
765 765 preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
766 766
767 767 re-delta-all
768 768 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
769 769
770 770 beginning upgrade...
771 771 repository locked and read-only
772 772 creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
773 773 (it is safe to interrupt this process any time before data migration completes)
774 774 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
775 775 migrating 1019 bytes in store; 882 bytes tracked data
776 776 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
777 777 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
778 778 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
779 779 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
780 780 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
781 781 finished migrating 3 changelog revisions; change in size: 0 bytes
782 782 finished migrating 9 total revisions; total change in store size: -9 bytes
783 783 copying phaseroots
784 784 data fully migrated to temporary repository
785 785 marking source repository as being upgraded; clients will be unable to read from repository
786 786 starting in-place swap of repository data
787 787 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
788 788 replacing store...
789 789 store replacement complete; repository was inconsistent for *s (glob)
790 790 finalizing requirements file and making repository readable again
791 791 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
792 792 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
793 793 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
794 794 $ hg debugdeltachain file
795 795 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
796 796 0 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
797 797 1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
798 798 2 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
799 799 $ cd ..
800 800
801 801 $ cat << EOF >> $HGRCPATH
802 802 > [format]
803 803 > maxchainlen = 9001
804 804 > EOF
805 805
806 806 Check upgrading a sparse-revlog repository
807 807 ---------------------------------------
808 808
809 809 $ hg init sparserevlogrepo --config format.sparse-revlog=no
810 810 $ cd sparserevlogrepo
811 811 $ touch foo
812 812 $ hg add foo
813 813 $ hg -q commit -m "foo"
814 814 $ cat .hg/requires
815 815 dotencode
816 816 fncache
817 817 generaldelta
818 818 revlogv1
819 819 store
820 820
821 821 Check that we can add the sparse-revlog format requirement
822 822 $ hg --config format.sparse-revlog=yes debugupgraderepo --run >/dev/null
823 823 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
824 824 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
825 825 $ cat .hg/requires
826 826 dotencode
827 827 fncache
828 828 generaldelta
829 829 revlogv1
830 830 sparserevlog
831 831 store
832 832
833 833 Check that we can remove the sparse-revlog format requirement
834 834 $ hg --config format.sparse-revlog=no debugupgraderepo --run >/dev/null
835 835 copy of old repository backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
836 836 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
837 837 $ cat .hg/requires
838 838 dotencode
839 839 fncache
840 840 generaldelta
841 841 revlogv1
842 842 store
843 843 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now