mercurial/subrepo.py
changeset 35965 533f04d4cb6d
parent 35928 c8e2d6ed1f9e
child 36047 55e8efa2451a
equal deleted inserted replaced
35964:d857cad588e4 35965:533f04d4cb6d
   917                           % (inst, subrelpath(self)))
   917                           % (inst, subrelpath(self)))
   918 
   918 
   919     @annotatesubrepoerror
   919     @annotatesubrepoerror
   920     def archive(self, archiver, prefix, match=None, decode=True):
   920     def archive(self, archiver, prefix, match=None, decode=True):
   921         self._get(self._state + ('hg',))
   921         self._get(self._state + ('hg',))
   922         total = abstractsubrepo.archive(self, archiver, prefix, match)
   922         files = self.files()
       
   923         if match:
       
   924             files = [f for f in files if match(f)]
   923         rev = self._state[1]
   925         rev = self._state[1]
   924         ctx = self._repo[rev]
   926         ctx = self._repo[rev]
       
   927         cmdutil._prefetchfiles(self._repo, ctx, files)
       
   928         total = abstractsubrepo.archive(self, archiver, prefix, match)
   925         for subpath in ctx.substate:
   929         for subpath in ctx.substate:
   926             s = subrepo(ctx, subpath, True)
   930             s = subrepo(ctx, subpath, True)
   927             submatch = matchmod.subdirmatcher(subpath, match)
   931             submatch = matchmod.subdirmatcher(subpath, match)
   928             total += s.archive(archiver, prefix + self._path + '/', submatch,
   932             total += s.archive(archiver, prefix + self._path + '/', submatch,
   929                                decode)
   933                                decode)