Mercurial > hg
diff mercurial/scmutil.py @ 36137:f52a9336ac5f
cmdutil: convert the prefetchfiles() hook to a callback mechanism (API)
Yuya suggested a list of callbacks instead of function wrapping. This means
that one extension can't block another from processing the list.
.. api::
File prefetching is now handled by registering a callback with
scmutil.fileprefetchhooks.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 11 Feb 2018 00:23:57 -0500 |
parents | 558e01a23f40 |
children | 4f3e989536c3 |
line wrap: on
line diff
--- a/mercurial/scmutil.py Tue Feb 13 00:54:36 2018 -0500 +++ b/mercurial/scmutil.py Sun Feb 11 00:23:57 2018 -0500 @@ -1222,6 +1222,11 @@ 'unbundle', ] +# a list of (repo, ctx, files) functions called by various commands to allow +# extensions to ensure the corresponding files are available locally, before the +# command uses them. +fileprefetchhooks = util.hooks() + # A marker that tells the evolve extension to suppress its own reporting _reportstroubledchangesets = True