Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
36136:6767e7ce2c31 | 36137:f52a9336ac5f |
---|---|
1220 _reportnewcssource = [ | 1220 _reportnewcssource = [ |
1221 'pull', | 1221 'pull', |
1222 'unbundle', | 1222 'unbundle', |
1223 ] | 1223 ] |
1224 | 1224 |
1225 # a list of (repo, ctx, files) functions called by various commands to allow | |
1226 # extensions to ensure the corresponding files are available locally, before the | |
1227 # command uses them. | |
1228 fileprefetchhooks = util.hooks() | |
1229 | |
1225 # A marker that tells the evolve extension to suppress its own reporting | 1230 # A marker that tells the evolve extension to suppress its own reporting |
1226 _reportstroubledchangesets = True | 1231 _reportstroubledchangesets = True |
1227 | 1232 |
1228 def registersummarycallback(repo, otr, txnname=''): | 1233 def registersummarycallback(repo, otr, txnname=''): |
1229 """register a callback to issue a summary after the transaction is closed | 1234 """register a callback to issue a summary after the transaction is closed |