[PATCH 2 of 6] export: invoke the file prefetch hook
Yuya Nishihara
yuya at tcha.org
Mon Apr 16 07:31:06 EDT 2018
On Sun, 15 Apr 2018 02:44:06 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1523749425 14400
> # Sat Apr 14 19:43:45 2018 -0400
> # Node ID 1c3654f7ed31e6770cbd97681083bab834554056
> # Parent de2975df3997148a832ef41425b069fc6f8ff3bc
> export: invoke the file prefetch hook
>
> cmdutil.exportfile() is only called by shelve, mq and patchbomb. Those are
> unlikely to mix with lfs, but it may as well be invoked there for completeness.
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -1619,6 +1619,12 @@ def export(repo, revs, basefm, fntemplat
> the given template.
> Otherwise: All revs will be written to basefm.
> '''
> + files = None
> + ctxs = [repo[r] for r in revs]
> + if match:
> + files = set([f for ctx in ctxs for f in ctx if match(f)])
> + scmutil.fileprefetchhooks(repo, ctxs, files)
Perhaps we'll need
fileprefetchhooks(repo, revs, match)
since it may take some time to build a list of ctxs and files.
We can reconstruct a matcher from files by scmutil.matchfiles().
More information about the Mercurial-devel
mailing list