Mercurial > public > mercurial-scm > hg
comparison mercurial/upgrade_utils/engine.py @ 46219:481d9aed669c
engine: make hook point for extension a public function
Well there are no private public functions in Python, but we generally treat
functions and variables starting with `_` as private ones.
A function which needs to be overrided in extension should be a public one.
Differential Revision: https://phab.mercurial-scm.org/D9672
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 31 Dec 2020 14:10:25 +0530 |
parents | 3f92a9bb80f0 |
children | 1ca7865c245d |
comparison
equal
deleted
inserted
replaced
46218:3f92a9bb80f0 | 46219:481d9aed669c |
---|---|
406 return False | 406 return False |
407 | 407 |
408 return True | 408 return True |
409 | 409 |
410 | 410 |
411 def _finishdatamigration(ui, srcrepo, dstrepo, requirements): | 411 def finishdatamigration(ui, srcrepo, dstrepo, requirements): |
412 """Hook point for extensions to perform additional actions during upgrade. | 412 """Hook point for extensions to perform additional actions during upgrade. |
413 | 413 |
414 This function is called after revlogs and store files have been copied but | 414 This function is called after revlogs and store files have been copied but |
415 before the new store is swapped into the original location. | 415 before the new store is swapped into the original location. |
416 """ | 416 """ |
456 srcrepo.ui.status(_(b'copying %s\n') % p) | 456 srcrepo.ui.status(_(b'copying %s\n') % p) |
457 src = srcrepo.store.rawvfs.join(p) | 457 src = srcrepo.store.rawvfs.join(p) |
458 dst = dstrepo.store.rawvfs.join(p) | 458 dst = dstrepo.store.rawvfs.join(p) |
459 util.copyfile(src, dst, copystat=True) | 459 util.copyfile(src, dst, copystat=True) |
460 | 460 |
461 _finishdatamigration(ui, srcrepo, dstrepo, requirements) | 461 finishdatamigration(ui, srcrepo, dstrepo, requirements) |
462 | 462 |
463 ui.status(_(b'data fully migrated to temporary repository\n')) | 463 ui.status(_(b'data fully migrated to temporary repository\n')) |
464 | 464 |
465 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path) | 465 backuppath = pycompat.mkdtemp(prefix=b'upgradebackup.', dir=srcrepo.path) |
466 backupvfs = vfsmod.vfs(backuppath) | 466 backupvfs = vfsmod.vfs(backuppath) |