Mercurial > hg
comparison mercurial/archival.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 | 16499427f6de |
children | 1a2ff11e8a88 |
comparison
equal
deleted
inserted
replaced
37761:ff6b0a20849d | 37762:7269b87f817c |
---|---|
318 else: | 318 else: |
319 files = ctx.manifest().keys() | 319 files = ctx.manifest().keys() |
320 total = len(files) | 320 total = len(files) |
321 if total: | 321 if total: |
322 files.sort() | 322 files.sort() |
323 scmutil.fileprefetchhooks(repo, ctx, files) | 323 scmutil.prefetchfiles(repo, [ctx.rev()], |
324 scmutil.matchfiles(repo, files)) | |
324 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total) | 325 repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total) |
325 for i, f in enumerate(files): | 326 for i, f in enumerate(files): |
326 ff = ctx.flags(f) | 327 ff = ctx.flags(f) |
327 write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data) | 328 write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, ctx[f].data) |
328 repo.ui.progress(_('archiving'), i + 1, item=f, | 329 repo.ui.progress(_('archiving'), i + 1, item=f, |