From patchwork Tue May 2 23:43:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,8] caches: stop warming the cache after 'localrepo.commitctx' From: Pierre-Yves David X-Patchwork-Id: 20367 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Wed, 03 May 2017 01:43:43 +0200 # HG changeset patch # User Pierre-Yves David # Date 1493744167 -7200 # Tue May 02 18:56:07 2017 +0200 # Branch stable # Node ID c6e50b7773cb84ccb5a56ba8cc637e113bf034e7 # Parent 7f3e26f6d05f0d65170616d77c38fd064911718f # EXP-Topic obscache # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ # hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r c6e50b7773cb 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. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1822,7 +1822,6 @@ class localrepository(object): # 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: diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -195,8 +195,8 @@ log rotation 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