# HG changeset patch # User Pierre-Yves David # Date 2019-03-15 09:07:23 # Node ID c3522b015f8156364b83624f72fe47af76be7153 # Parent 7d417ab1eda988f10363b27a065250a7e25a0abb 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):