##// END OF EJS Templates
upgrade: add a 'redeltafullall' mode...
Boris Feld -
r35346:6226668a default
parent child Browse files
Show More
@@ -2264,7 +2264,9 b' class revlog(object):'
2264 DELTAREUSESAMEREVS = 'samerevs'
2264 DELTAREUSESAMEREVS = 'samerevs'
2265 DELTAREUSENEVER = 'never'
2265 DELTAREUSENEVER = 'never'
2266
2266
2267 DELTAREUSEALL = {'always', 'samerevs', 'never'}
2267 DELTAREUSEFULLADD = 'fulladd'
2268
2269 DELTAREUSEALL = {'always', 'samerevs', 'never', 'fulladd'}
2268
2270
2269 def clone(self, tr, destrevlog, addrevisioncb=None,
2271 def clone(self, tr, destrevlog, addrevisioncb=None,
2270 deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None):
2272 deltareuse=DELTAREUSESAMEREVS, aggressivemergedeltas=None):
@@ -2355,18 +2357,24 b' class revlog(object):'
2355 if not cachedelta:
2357 if not cachedelta:
2356 rawtext = self.revision(rev, raw=True)
2358 rawtext = self.revision(rev, raw=True)
2357
2359
2358 ifh = destrevlog.opener(destrevlog.indexfile, 'a+',
2360
2359 checkambig=False)
2361 if deltareuse == self.DELTAREUSEFULLADD:
2360 dfh = None
2362 destrevlog.addrevision(rawtext, tr, linkrev, p1, p2,
2361 if not destrevlog._inline:
2363 cachedelta=cachedelta,
2362 dfh = destrevlog.opener(destrevlog.datafile, 'a+')
2364 node=node, flags=flags)
2363 try:
2365 else:
2364 destrevlog._addrevision(node, rawtext, tr, linkrev, p1, p2,
2366 ifh = destrevlog.opener(destrevlog.indexfile, 'a+',
2365 flags, cachedelta, ifh, dfh)
2367 checkambig=False)
2366 finally:
2368 dfh = None
2367 if dfh:
2369 if not destrevlog._inline:
2368 dfh.close()
2370 dfh = destrevlog.opener(destrevlog.datafile, 'a+')
2369 ifh.close()
2371 try:
2372 destrevlog._addrevision(node, rawtext, tr, linkrev, p1,
2373 p2, flags, cachedelta, ifh, dfh)
2374 finally:
2375 if dfh:
2376 dfh.close()
2377 ifh.close()
2370
2378
2371 if addrevisioncb:
2379 if addrevisioncb:
2372 addrevisioncb(self, rev, node)
2380 addrevisioncb(self, rev, node)
@@ -369,6 +369,19 b' def findoptimizations(repo):'
369 'recomputed; this will likely drastically slow down '
369 'recomputed; this will likely drastically slow down '
370 'execution time')))
370 'execution time')))
371
371
372 optimizations.append(improvement(
373 name='redeltafulladd',
374 type=optimisation,
375 description=_('every revision will be re-added as if it was new '
376 'content. It will go through the full storage '
377 'mechanism giving extensions a chance to process it '
378 '(eg. lfs). This is similar to "redeltaall" but even '
379 'slower since more logic is involved.'),
380 upgrademessage=_('each revision will be added as new content to the '
381 'internal storage; this will likely drastically slow '
382 'down execution time, but some extensions might need '
383 'it')))
384
372 return optimizations
385 return optimizations
373
386
374 def determineactions(repo, deficiencies, sourcereqs, destreqs):
387 def determineactions(repo, deficiencies, sourcereqs, destreqs):
@@ -618,6 +631,8 b' def _upgraderepo(ui, srcrepo, dstrepo, r'
618 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
631 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
619 elif 'redeltamultibase' in actions:
632 elif 'redeltamultibase' in actions:
620 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
633 deltareuse = revlog.revlog.DELTAREUSESAMEREVS
634 if 'redeltafulladd' in actions:
635 deltareuse = revlog.revlog.DELTAREUSEFULLADD
621 else:
636 else:
622 deltareuse = revlog.revlog.DELTAREUSEALWAYS
637 deltareuse = revlog.revlog.DELTAREUSEALWAYS
623
638
@@ -100,6 +100,9 b' An upgrade of a repository created with '
100 redeltaall
100 redeltaall
101 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
101 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
102
102
103 redeltafulladd
104 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 "redeltaall" but even slower since more logic is involved.
105
103
106
104 --optimize can be used to add optimizations
107 --optimize can be used to add optimizations
105
108
@@ -121,6 +124,9 b' An upgrade of a repository created with '
121 redeltaall
124 redeltaall
122 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
125 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
123
126
127 redeltafulladd
128 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 "redeltaall" but even slower since more logic is involved.
129
124
130
125 Various sub-optimal detections work
131 Various sub-optimal detections work
126
132
@@ -196,6 +202,9 b' Various sub-optimal detections work'
196 redeltaall
202 redeltaall
197 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
203 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
198
204
205 redeltafulladd
206 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 "redeltaall" but even slower since more logic is involved.
207
199
208
200 $ hg --config format.dotencode=false debugupgraderepo
209 $ hg --config format.dotencode=false debugupgraderepo
201 repository lacks features recommended by current config options:
210 repository lacks features recommended by current config options:
@@ -235,6 +244,9 b' Various sub-optimal detections work'
235 redeltaall
244 redeltaall
236 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
245 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
237
246
247 redeltafulladd
248 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 "redeltaall" but even slower since more logic is involved.
249
238
250
239 $ cd ..
251 $ cd ..
240
252
@@ -406,6 +418,40 b" store files with special filenames aren'"
406 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
418 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
407 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
419 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
408 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
420 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
421 $ hg debugupgraderepo --run --optimize redeltafulladd
422 upgrade will perform the following actions:
423
424 requirements
425 preserved: dotencode, fncache, generaldelta, revlogv1, store
426
427 redeltafulladd
428 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
429
430 beginning upgrade...
431 repository locked and read-only
432 creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
433 (it is safe to interrupt this process any time before data migration completes)
434 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
435 migrating 109 bytes in store; 107 bytes tracked data
436 migrating 1 filelogs containing 1 revisions (0 bytes in store; 0 bytes tracked data)
437 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
438 migrating 1 manifests containing 1 revisions (46 bytes in store; 45 bytes tracked data)
439 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
440 migrating changelog containing 1 revisions (63 bytes in store; 62 bytes tracked data)
441 finished migrating 1 changelog revisions; change in size: 0 bytes
442 finished migrating 3 total revisions; total change in store size: 0 bytes
443 copying .XX_special_filename
444 copying phaseroots
445 data fully migrated to temporary repository
446 marking source repository as being upgraded; clients will be unable to read from repository
447 starting in-place swap of repository data
448 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
449 replacing store...
450 store replacement complete; repository was inconsistent for 0.0s
451 finalizing requirements file and making repository readable again
452 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
453 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
454 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
409
455
410 $ cd ..
456 $ cd ..
411
457
General Comments 0
You need to be logged in to leave comments. Login now