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
--- a/hgext/lfs/wrapper.py Wed Dec 30 16:39:35 2020 +0530
+++ b/hgext/lfs/wrapper.py Thu Dec 31 14:10:25 2020 +0530
@@ -524,7 +524,7 @@
remoteblob.writebatch(pointers, repo.svfs.lfslocalblobstore)
-@eh.wrapfunction(upgrade_engine, b'_finishdatamigration')
+@eh.wrapfunction(upgrade_engine, b'finishdatamigration')
def upgradefinishdatamigration(orig, ui, srcrepo, dstrepo, requirements):
orig(ui, srcrepo, dstrepo, requirements)
--- a/mercurial/upgrade_utils/engine.py Wed Dec 30 16:39:35 2020 +0530
+++ b/mercurial/upgrade_utils/engine.py Thu Dec 31 14:10:25 2020 +0530
@@ -408,7 +408,7 @@
return True
-def _finishdatamigration(ui, srcrepo, dstrepo, requirements):
+def finishdatamigration(ui, srcrepo, dstrepo, requirements):
"""Hook point for extensions to perform additional actions during upgrade.
This function is called after revlogs and store files have been copied but
@@ -458,7 +458,7 @@
dst = dstrepo.store.rawvfs.join(p)
util.copyfile(src, dst, copystat=True)
- _finishdatamigration(ui, srcrepo, dstrepo, requirements)
+ finishdatamigration(ui, srcrepo, dstrepo, requirements)
ui.status(_(b'data fully migrated to temporary repository\n'))