[PATCH 1 of 4 V2] scmutil: teach the file prefetch hook to handle multiple commits
Yuya Nishihara
yuya at tcha.org
Tue Apr 17 07:34:04 EDT 2018
On Mon, 16 Apr 2018 15:07:09 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1523746245 14400
> # Sat Apr 14 18:50:45 2018 -0400
> # Node ID fe6824bcc6b8228f2eb141ea96efb6797b5530d7
> # Parent 1859b9a7ddefe90971259da0793e9289fd65c63f
> scmutil: teach the file prefetch hook to handle multiple commits
Queued, thanks.
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -2258,16 +2258,15 @@ def cat(ui, repo, ctx, matcher, basefm,
> mfnode = ctx.manifestnode()
> try:
> if mfnode and mfl[mfnode].find(file)[0]:
> - scmutil.fileprefetchhooks(repo, ctx, [file])
> + scmutil.prefetchfiles(repo, [ctx.rev()], matcher)
> write(file)
> return 0
> except KeyError:
> pass
>
> - files = [f for f in ctx.walk(matcher)]
> - scmutil.fileprefetchhooks(repo, ctx, files)
> -
> - for abs in files:
> + scmutil.prefetchfiles(repo, [ctx.rev()], matcher)
Nit: these prefetchfiles() could be moved before the fast path.
More information about the Mercurial-devel
mailing list