# HG changeset patch # User Matt Harbison # Date 2018-02-11 05:30:15 # Node ID a991fcc482228215b44e966dacf86bc69a89b184 # Parent f52a9336ac5fb78f08b45221dd4de4d5bfeaf94e lfs: migrate to the fileprefetch callback mechanism diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py +++ b/hgext/lfs/__init__.py @@ -334,7 +334,8 @@ def extsetup(ui): 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 diff --git a/hgext/lfs/wrapper.py b/hgext/lfs/wrapper.py --- a/hgext/lfs/wrapper.py +++ b/hgext/lfs/wrapper.py @@ -266,12 +266,6 @@ def _prefetchfiles(repo, ctx, files): 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,