Patchwork D9672: engine: make hook point for extension a public function

login
register
mail settings
Submitter phabricator
Date Dec. 31, 2020, 4:42 p.m.
Message ID <differential-rev-PHID-DREV-usvdy25hbicr3cpkvxfh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47983/
State Superseded
Headers show

Comments

phabricator - Dec. 31, 2020, 4:42 p.m.
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9672

AFFECTED FILES
  hgext/lfs/wrapper.py
  mercurial/upgrade_utils/engine.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/upgrade_utils/engine.py b/mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py
+++ b/mercurial/upgrade_utils/engine.py
@@ -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'))
 
diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py
--- a/hgext/lfs/wrapper.py
+++ b/hgext/lfs/wrapper.py
@@ -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)