# HG changeset patch # User Martin von Zweigbergk # Date 1516393983 28800 # Node ID 3a3b59bbe7ce37c8b90add5fcd9d8f3e69b32db9 # Parent 963a611b2f396d507b5784c0ec1905e134b0c898 localrepo: run cache-warming transaction callback before report callback See in-code comment for details. Differential Revision: https://phab.mercurial-scm.org/D1918 diff -r 963a611b2f39 -r 3a3b59bbe7ce mercurial/localrepo.py --- a/mercurial/localrepo.py Fri Jan 19 11:35:55 2018 -0800 +++ b/mercurial/localrepo.py Fri Jan 19 12:33:03 2018 -0800 @@ -1322,7 +1322,11 @@ **pycompat.strkwargs(hookargs)) reporef()._afterlock(hookfunc) tr.addfinalize('txnclose-hook', txnclosehook) - tr.addpostclose('warms-cache', self._buildcacheupdater(tr)) + # Include a leading "-" to make it happen before the transaction summary + # reports registered via scmutil.registersummarycallback() whose names + # are 00-txnreport etc. That way, the caches will be warm when the + # callbacks run. + tr.addpostclose('-warm-cache', self._buildcacheupdater(tr)) def txnaborthook(tr2): """To be run if transaction is aborted """ diff -r 963a611b2f39 -r 3a3b59bbe7ce tests/test-obsolete-changeset-exchange.t --- a/tests/test-obsolete-changeset-exchange.t Fri Jan 19 11:35:55 2018 -0800 +++ b/tests/test-obsolete-changeset-exchange.t Fri Jan 19 12:33:03 2018 -0800 @@ -171,6 +171,6 @@ bundle2-input-part: total payload size 24 bundle2-input-bundle: 2 parts total checking for updated bookmarks + updating the branch cache new changesets bec0734cd68e - updating the branch cache (run 'hg heads' to see heads, 'hg merge' to merge)