Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 35749:3a3b59bbe7ce
localrepo: run cache-warming transaction callback before report callback
See in-code comment for details.
Differential Revision: https://phab.mercurial-scm.org/D1918
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 19 Jan 2018 12:33:03 -0800 |
parents | 29f57ce416ed |
children | c97639ad6874 |
comparison
equal
deleted
inserted
replaced
35748:963a611b2f39 | 35749:3a3b59bbe7ce |
---|---|
1320 | 1320 |
1321 repo.hook('txnclose', throw=False, txnname=desc, | 1321 repo.hook('txnclose', throw=False, txnname=desc, |
1322 **pycompat.strkwargs(hookargs)) | 1322 **pycompat.strkwargs(hookargs)) |
1323 reporef()._afterlock(hookfunc) | 1323 reporef()._afterlock(hookfunc) |
1324 tr.addfinalize('txnclose-hook', txnclosehook) | 1324 tr.addfinalize('txnclose-hook', txnclosehook) |
1325 tr.addpostclose('warms-cache', self._buildcacheupdater(tr)) | 1325 # Include a leading "-" to make it happen before the transaction summary |
1326 # reports registered via scmutil.registersummarycallback() whose names | |
1327 # are 00-txnreport etc. That way, the caches will be warm when the | |
1328 # callbacks run. | |
1329 tr.addpostclose('-warm-cache', self._buildcacheupdater(tr)) | |
1326 def txnaborthook(tr2): | 1330 def txnaborthook(tr2): |
1327 """To be run if transaction is aborted | 1331 """To be run if transaction is aborted |
1328 """ | 1332 """ |
1329 reporef().hook('txnabort', throw=False, txnname=desc, | 1333 reporef().hook('txnabort', throw=False, txnname=desc, |
1330 **tr2.hookargs) | 1334 **tr2.hookargs) |