changeset 36138:a991fcc48222

lfs: migrate to the fileprefetch callback mechanism
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 11 Feb 2018 00:30:15 -0500
parents f52a9336ac5f
children b72c6ff4e4c0
files hgext/lfs/__init__.py hgext/lfs/wrapper.py
diffstat 2 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/lfs/__init__.py	Sun Feb 11 00:23:57 2018 -0500
+++ b/hgext/lfs/__init__.py	Sun Feb 11 00:30:15 2018 -0500
@@ -334,7 +334,8 @@
     wrapfunction(hg, 'postshare', wrapper.hgpostshare)
 
     wrapfunction(merge, 'applyupdates', wrapper.mergemodapplyupdates)
-    wrapfunction(cmdutil, '_prefetchfiles', wrapper.cmdutilprefetchfiles)
+
+    scmutil.fileprefetchhooks.add('lfs', wrapper._prefetchfiles)
 
     # Make bundle choose changegroup3 instead of changegroup2. This affects
     # "hg bundle" command. Note: it does not cover all bundle formats like
--- a/hgext/lfs/wrapper.py	Sun Feb 11 00:23:57 2018 -0500
+++ b/hgext/lfs/wrapper.py	Sun Feb 11 00:30:15 2018 -0500
@@ -266,12 +266,6 @@
     if pointers:
         repo.svfs.lfsremoteblobstore.readbatch(pointers, localstore)
 
-def cmdutilprefetchfiles(orig, repo, ctx, files):
-    """Prefetch the indicated files before they are accessed by a command."""
-    orig(repo, ctx, files)
-
-    _prefetchfiles(repo, ctx, files)
-
 def mergemodapplyupdates(orig, repo, actions, wctx, mctx, overwrite,
                          labels=None):
     """Ensure that the required LFS blobs are present before applying updates,