Mercurial > hg > mercurial-source
diff mercurial/scmutil.py @ 36923: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 (2018-02-11) |
parents | 558e01a23f40 |
children | 4f3e989536c3 |
line wrap: on
line diff
--- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -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