# HG changeset patch # User Gregory Szorc # Date 1442096207 25200 # 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 -r eb97d49768cc -r d708873f1f33 mercurial/revlog.py --- a/mercurial/revlog.py Sat Sep 12 12:47:00 2015 -0700 +++ b/mercurial/revlog.py Sat Sep 12 15:16:47 2015 -0700 @@ -1049,14 +1049,13 @@ 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 @@ if iterrev == cachedrev: # cache hit - text = _cache[2] + text = self._cache[2] else: chain.append(iterrev) chain.reverse()