comparison mercurial/subrepo.py @ 37762:7269b87f817c

scmutil: teach the file prefetch hook to handle multiple commits The remainder of the commands that need prefetch deal with multiple revisions. I initially coded this as a separate hook, but then it needed a list of files to handle `diff` and `grep`, so it didn't seem worth keeping them separate. Not every matcher will emit bad file messages (some are built from a list of files that are known to exist). But it seems better to filter this in one place than to push this on either each caller or each hook implementation.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 14 Apr 2018 18:50:45 -0400
parents e7bf5a73e4e1
children f10cb49951e1
comparison
equal deleted inserted replaced
37761:ff6b0a20849d 37762:7269b87f817c
560 files = self.files() 560 files = self.files()
561 if match: 561 if match:
562 files = [f for f in files if match(f)] 562 files = [f for f in files if match(f)]
563 rev = self._state[1] 563 rev = self._state[1]
564 ctx = self._repo[rev] 564 ctx = self._repo[rev]
565 scmutil.fileprefetchhooks(self._repo, ctx, files) 565 scmutil.prefetchfiles(self._repo, [ctx.rev()],
566 scmutil.matchfiles(self._repo, files))
566 total = abstractsubrepo.archive(self, archiver, prefix, match) 567 total = abstractsubrepo.archive(self, archiver, prefix, match)
567 for subpath in ctx.substate: 568 for subpath in ctx.substate:
568 s = subrepo(ctx, subpath, True) 569 s = subrepo(ctx, subpath, True)
569 submatch = matchmod.subdirmatcher(subpath, match) 570 submatch = matchmod.subdirmatcher(subpath, match)
570 total += s.archive(archiver, prefix + self._path + '/', submatch, 571 total += s.archive(archiver, prefix + self._path + '/', submatch,