--- a/mercurial/cmdutil.py Sat Feb 03 21:26:12 2018 -0500
+++ b/mercurial/cmdutil.py Sun Feb 04 14:14:28 2018 -0500
@@ -2862,7 +2862,14 @@
if not opts.get('dry_run'):
needdata = ('revert', 'add', 'undelete')
- _revertprefetch(repo, ctx, *[actions[name][0] for name in needdata])
+ if _revertprefetch is not _revertprefetchstub:
+ ui.deprecwarn("'cmdutil._revertprefetch' is deprecated, use "
+ "'cmdutil._prefetchfiles'", '4.6', stacklevel=1)
+ _revertprefetch(repo, ctx,
+ *[actions[name][0] for name in needdata])
+ oplist = [actions[name][0] for name in needdata]
+ _prefetchfiles(repo, ctx,
+ [f for sublist in oplist for f in sublist])
_performrevert(repo, parents, ctx, actions, interactive, tobackup)
if targetsubs:
@@ -2875,8 +2882,15 @@
raise error.Abort("subrepository '%s' does not exist in %s!"
% (sub, short(ctx.node())))
-def _revertprefetch(repo, ctx, *files):
- """Let extension changing the storage layer prefetch content"""
+def _revertprefetchstub(repo, ctx, *files):
+ """Stub method for detecting extension wrapping of _revertprefetch(), to
+ issue a deprecation warning."""
+
+_revertprefetch = _revertprefetchstub
+
+def _prefetchfiles(repo, ctx, files):
+ """Let extensions changing the storage layer prefetch content for any non
+ merge based command."""
def _performrevert(repo, parents, ctx, actions, interactive=False,
tobackup=None):