mercurial/cmdutil.py
changeset 37762 7269b87f817c
parent 37756 e7bf5a73e4e1
child 37763 b54404d66f7e
--- a/mercurial/cmdutil.py	Mon Apr 16 23:39:30 2018 -0400
+++ b/mercurial/cmdutil.py	Sat Apr 14 18:50:45 2018 -0400
@@ -2292,16 +2292,15 @@
         mfnode = ctx.manifestnode()
         try:
             if mfnode and mfl[mfnode].find(file)[0]:
-                scmutil.fileprefetchhooks(repo, ctx, [file])
+                scmutil.prefetchfiles(repo, [ctx.rev()], matcher)
                 write(file)
                 return 0
         except KeyError:
             pass
 
-    files = [f for f in ctx.walk(matcher)]
-    scmutil.fileprefetchhooks(repo, ctx, files)
-
-    for abs in files:
+    scmutil.prefetchfiles(repo, [ctx.rev()], matcher)
+
+    for abs in ctx.walk(matcher):
         write(abs)
         err = 0
 
@@ -2979,8 +2978,11 @@
                 _revertprefetch(repo, ctx,
                                 *[actions[name][0] for name in needdata])
             oplist = [actions[name][0] for name in needdata]
-            prefetch = scmutil.fileprefetchhooks
-            prefetch(repo, ctx, [f for sublist in oplist for f in sublist])
+            prefetch = scmutil.prefetchfiles
+            matchfiles = scmutil.matchfiles
+            prefetch(repo, [ctx.rev()],
+                     matchfiles(repo,
+                                [f for sublist in oplist for f in sublist]))
             _performrevert(repo, parents, ctx, actions, interactive, tobackup)
 
         if targetsubs: