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