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