diff mercurial/subrepo.py @ 35925:533f04d4cb6d

archive: call the storage prefetch hook
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 04 Feb 2018 14:31:32 -0500
parents c8e2d6ed1f9e
children 55e8efa2451a
line wrap: on
line diff
--- a/mercurial/subrepo.py	Sun Feb 04 00:33:28 2018 -0500
+++ b/mercurial/subrepo.py	Sun Feb 04 14:31:32 2018 -0500
@@ -919,9 +919,13 @@
     @annotatesubrepoerror
     def archive(self, archiver, prefix, match=None, decode=True):
         self._get(self._state + ('hg',))
-        total = abstractsubrepo.archive(self, archiver, prefix, match)
+        files = self.files()
+        if match:
+            files = [f for f in files if match(f)]
         rev = self._state[1]
         ctx = self._repo[rev]
+        cmdutil._prefetchfiles(self._repo, ctx, files)
+        total = abstractsubrepo.archive(self, archiver, prefix, match)
         for subpath in ctx.substate:
             s = subrepo(ctx, subpath, True)
             submatch = matchmod.subdirmatcher(subpath, match)