Show More
@@ -408,6 +408,25 b' def _filterstorefile(srcrepo, dstrepo, r' | |||||
408 | return True |
|
408 | return True | |
409 |
|
409 | |||
410 |
|
410 | |||
|
411 | def _replacestores(currentrepo, upgradedrepo, backupvfs, upgrade_op): | |||
|
412 | """Replace the stores after current repository is upgraded | |||
|
413 | ||||
|
414 | Creates a backup of current repository store at backup path | |||
|
415 | Replaces upgraded store files in current repo from upgraded one | |||
|
416 | ||||
|
417 | Arguments: | |||
|
418 | currentrepo: repo object of current repository | |||
|
419 | upgradedrepo: repo object of the upgraded data | |||
|
420 | backupvfs: vfs object for the backup path | |||
|
421 | upgrade_op: upgrade operation object | |||
|
422 | to be used to decide what all is upgraded | |||
|
423 | """ | |||
|
424 | # TODO: don't blindly rename everything in store | |||
|
425 | # There can be upgrades where store is not touched at all | |||
|
426 | util.rename(currentrepo.spath, backupvfs.join(b'store')) | |||
|
427 | util.rename(upgradedrepo.spath, currentrepo.spath) | |||
|
428 | ||||
|
429 | ||||
411 | def finishdatamigration(ui, srcrepo, dstrepo, requirements): |
|
430 | def finishdatamigration(ui, srcrepo, dstrepo, requirements): | |
412 | """Hook point for extensions to perform additional actions during upgrade. |
|
431 | """Hook point for extensions to perform additional actions during upgrade. | |
413 |
|
432 | |||
@@ -490,8 +509,7 b' def upgrade(ui, srcrepo, dstrepo, upgrad' | |||||
490 | # environments). |
|
509 | # environments). | |
491 | ui.status(_(b'replacing store...\n')) |
|
510 | ui.status(_(b'replacing store...\n')) | |
492 | tstart = util.timer() |
|
511 | tstart = util.timer() | |
493 | util.rename(srcrepo.spath, backupvfs.join(b'store')) |
|
512 | _replacestores(srcrepo, dstrepo, backupvfs, upgrade_op) | |
494 | util.rename(dstrepo.spath, srcrepo.spath) |
|
|||
495 | elapsed = util.timer() - tstart |
|
513 | elapsed = util.timer() - tstart | |
496 | ui.status( |
|
514 | ui.status( | |
497 | _( |
|
515 | _( |
General Comments 0
You need to be logged in to leave comments.
Login now