##// END OF EJS Templates
cmdutil: convert the prefetchfiles() hook to a callback mechanism (API)...
Matt Harbison -
r36154:f52a9336 default
parent child Browse files
Show More
@@ -2865,8 +2865,9 b' def revert(ui, repo, ctx, parents, *pats'
2865 if not opts.get('dry_run'):
2865 if not opts.get('dry_run'):
2866 needdata = ('revert', 'add', 'undelete')
2866 needdata = ('revert', 'add', 'undelete')
2867 if _revertprefetch is not _revertprefetchstub:
2867 if _revertprefetch is not _revertprefetchstub:
2868 ui.deprecwarn("'cmdutil._revertprefetch' is deprecated, use "
2868 ui.deprecwarn("'cmdutil._revertprefetch' is deprecated, "
2869 "'cmdutil._prefetchfiles'", '4.6', stacklevel=1)
2869 "add a callback to 'scmutil.fileprefetchhooks'",
2870 '4.6', stacklevel=1)
2870 _revertprefetch(repo, ctx,
2871 _revertprefetch(repo, ctx,
2871 *[actions[name][0] for name in needdata])
2872 *[actions[name][0] for name in needdata])
2872 oplist = [actions[name][0] for name in needdata]
2873 oplist = [actions[name][0] for name in needdata]
@@ -2893,6 +2894,7 b' def _revertprefetchstub(repo, ctx, *file'
2893 def _prefetchfiles(repo, ctx, files):
2894 def _prefetchfiles(repo, ctx, files):
2894 """Let extensions changing the storage layer prefetch content for any non
2895 """Let extensions changing the storage layer prefetch content for any non
2895 merge based command."""
2896 merge based command."""
2897 scmutil.fileprefetchhooks(repo, ctx, files)
2896
2898
2897 def _performrevert(repo, parents, ctx, actions, interactive=False,
2899 def _performrevert(repo, parents, ctx, actions, interactive=False,
2898 tobackup=None):
2900 tobackup=None):
@@ -1222,6 +1222,11 b' class simplekeyvaluefile(object):'
1222 'unbundle',
1222 'unbundle',
1223 ]
1223 ]
1224
1224
1225 # a list of (repo, ctx, files) functions called by various commands to allow
1226 # extensions to ensure the corresponding files are available locally, before the
1227 # command uses them.
1228 fileprefetchhooks = util.hooks()
1229
1225 # A marker that tells the evolve extension to suppress its own reporting
1230 # A marker that tells the evolve extension to suppress its own reporting
1226 _reportstroubledchangesets = True
1231 _reportstroubledchangesets = True
1227
1232
General Comments 0
You need to be logged in to leave comments. Login now