##// END OF EJS Templates
revlog: hold a private reference to self._cache...
Matt Mackall -
r21750:4ab287c2 stable
parent child Browse files
Show More
@@ -972,13 +972,14 b' class revlog(object):'
972 node = nodeorrev
972 node = nodeorrev
973 rev = None
973 rev = None
974
974
975 _cache = self._cache # grab local copy of cache to avoid thread race
975 cachedrev = None
976 cachedrev = None
976 if node == nullid:
977 if node == nullid:
977 return ""
978 return ""
978 if self._cache:
979 if _cache:
979 if self._cache[0] == node:
980 if _cache[0] == node:
980 return self._cache[2]
981 return _cache[2]
981 cachedrev = self._cache[1]
982 cachedrev = _cache[1]
982
983
983 # look up what we need to read
984 # look up what we need to read
984 text = None
985 text = None
@@ -1006,7 +1007,7 b' class revlog(object):'
1006
1007
1007 if iterrev == cachedrev:
1008 if iterrev == cachedrev:
1008 # cache hit
1009 # cache hit
1009 text = self._cache[2]
1010 text = _cache[2]
1010 else:
1011 else:
1011 chain.append(iterrev)
1012 chain.append(iterrev)
1012 chain.reverse()
1013 chain.reverse()
General Comments 0
You need to be logged in to leave comments. Login now