caches: stop warming the cache after 'localrepo.commitctx'
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 02 May 2017 18:56:07 +0200
changeset 32266 2b6692df1bdf
parent 32265 ccef71de7d41
child 32267 c2380b448265
caches: stop warming the cache after 'localrepo.commitctx' Now that we garantee that branchmap cache are updated at the end of the transaction we can drop that one. This removes a problematic case with nested transaction where the new cache could be written on disk before the transaction is finished. The test change is harmless, since we update the cache at a later point, the dirstate have been updated in between.
mercurial/localrepo.py
tests/test-blackbox.t
--- a/mercurial/localrepo.py	Tue May 02 21:35:06 2017 +0200
+++ b/mercurial/localrepo.py	Tue May 02 18:56:07 2017 +0200
@@ -1794,7 +1794,6 @@
                 # if minimal phase was 0 we don't need to retract anything
                 phases.retractboundary(self, tr, targetphase, [n])
             tr.close()
-            branchmap.updatecache(self.filtered('served'))
             return n
         finally:
             if tr:
--- a/tests/test-blackbox.t	Tue May 02 21:35:06 2017 +0200
+++ b/tests/test-blackbox.t	Tue May 02 18:56:07 2017 +0200
@@ -195,8 +195,8 @@
   result: None
   $ hg blackbox
   1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> commit -m commit2 -d 2000-01-02 foo
-  1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> updated served branch cache in * seconds (glob)
-  1970/01/01 00:00:00 bob @0e46349438790c460c5c9f7546bfcd39b267bbd2 (5000)> wrote served branch cache with 1 labels and 1 nodes
+  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> updated served branch cache in * seconds (glob)
+  1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> wrote served branch cache with 1 labels and 1 nodes
   1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> commit -m commit2 -d 2000-01-02 foo exited 0 after * seconds (glob)
   1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> log -r 0
   1970/01/01 00:00:00 bob @45589e459b2edfbf3dbde7e01f611d2c1e7453d7 (5000)> writing .hg/cache/tags2-visible with 0 tags