[PATCH 4 of 8 "] manifestcache: skip setup earlier if we don't have the lock

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat Mar 16 06:36:25 EDT 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1552640843 0
#      Fri Mar 15 09:07:23 2019 +0000
# Node ID 79362091afef9fb409ebe8385172ca2fa4aa4cd4
# Parent  6c22a53a7afe8b4b46989a62a71b7fc1c4e11ec6
# EXP-Topic manifestcache
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 79362091afef
manifestcache: skip setup earlier if we don't have the lock

There a no point preparing a closure if we are not going to use it.

diff --git a/mercurial/manifest.py b/mercurial/manifest.py
--- a/mercurial/manifest.py
+++ b/mercurial/manifest.py
@@ -1437,6 +1437,9 @@ class manifestrevlog(object):
             return
 
         self._fulltextcache._opener = repo.cachevfs
+        if repo._currentlock(repo._lockref) is None:
+            return
+
         reporef = weakref.ref(repo)
         manifestrevlogref = weakref.ref(self)
 
@@ -1450,8 +1453,7 @@ class manifestrevlog(object):
                 return
             self._fulltextcache.write()
 
-        if repo._currentlock(repo._lockref) is not None:
-            repo._afterlock(persistmanifestcache)
+        repo._afterlock(persistmanifestcache)
 
     @property
     def fulltextcache(self):


More information about the Mercurial-devel mailing list