--- 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)