Patchwork D1918: localrepo: run cache-warming transaction callback before report callback

login
register
mail settings
Submitter phabricator
Date Jan. 19, 2018, 9:32 p.m.
Message ID <2f282c6a1557ff4ad4ddfd8006ae1bd7@localhost.localdomain>
Download mbox | patch
Permalink /patch/26983/
State Not Applicable
Headers show

Comments

phabricator - Jan. 19, 2018, 9:32 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3a3b59bbe7ce: localrepo: run cache-warming transaction callback before report callback (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1918?vs=4956&id=4958

REVISION DETAIL
  https://phab.mercurial-scm.org/D1918

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-obsolete-changeset-exchange.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/tests/test-obsolete-changeset-exchange.t b/tests/test-obsolete-changeset-exchange.t
--- a/tests/test-obsolete-changeset-exchange.t
+++ b/tests/test-obsolete-changeset-exchange.t
@@ -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)
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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
             """