changeset 41961:c3522b015f81

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 15 Mar 2019 09:07:23 +0000
parents 7d417ab1eda9
children 07c80298b5a1
files mercurial/manifest.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Thu Mar 14 11:46:18 2019 +0000
+++ b/mercurial/manifest.py	Fri Mar 15 09:07:23 2019 +0000
@@ -1437,6 +1437,9 @@
             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 @@
                 return
             self._fulltextcache.write()
 
-        if repo._currentlock(repo._lockref) is not None:
-            repo._afterlock(persistmanifestcache)
+        repo._afterlock(persistmanifestcache)
 
     @property
     def fulltextcache(self):