# HG changeset patch # User Gregory Szorc # Date 2015-09-12 22:16:47 # Node ID d708873f1f33a0718cf490370f6335d9d6cac840 # Parent eb97d49768ccec62e3ebaafefba0e45824c596b7 revlog: drop local assignment of cache variable The purpose of this code was to provide thread safety. With the conversion of hgweb to use separate localrepository instances per request/thread, we should no longer have any consumers that need to access revlog instances from multiple threads. Remove the code. diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1049,14 +1049,13 @@ class revlog(object): node = nodeorrev rev = None - _cache = self._cache # grab local copy of cache to avoid thread race cachedrev = None if node == nullid: return "" - if _cache: - if _cache[0] == node: - return _cache[2] - cachedrev = _cache[1] + if self._cache: + if self._cache[0] == node: + return self._cache[2] + cachedrev = self._cache[1] # look up what we need to read text = None @@ -1084,7 +1083,7 @@ class revlog(object): if iterrev == cachedrev: # cache hit - text = _cache[2] + text = self._cache[2] else: chain.append(iterrev) chain.reverse()