##// END OF EJS Templates
revlog: mark cache private
Matt Mackall -
r4984:b4066fcb default
parent child Browse files
Show More
@@ -104,8 +104,8 b' class bundlerevlog(revlog.revlog):'
104 104 rev = self.rev(iter_node)
105 105 # reconstruct the revision if it is from a changegroup
106 106 while self.bundle(rev):
107 if self.cache and self.cache[0] == iter_node:
108 text = self.cache[2]
107 if self._cache and self._cache[0] == iter_node:
108 text = self._cache[2]
109 109 break
110 110 chain.append(rev)
111 111 iter_node = self.bundlebase(rev)
@@ -122,7 +122,7 b' class bundlerevlog(revlog.revlog):'
122 122 raise revlog.RevlogError(_("integrity check failed on %s:%d")
123 123 % (self.datafile, self.rev(node)))
124 124
125 self.cache = (node, self.rev(node), text)
125 self._cache = (node, self.rev(node), text)
126 126 return text
127 127
128 128 def addrevision(self, text, transaction, link, p1=None, p2=None, d=None):
@@ -409,9 +409,8 b' class revlog(object):'
409 409 self.indexfile = indexfile
410 410 self.datafile = indexfile[:-2] + ".d"
411 411 self.opener = opener
412
413 412 self.indexstat = None
414 self.cache = None
413 self._cache = None
415 414 self._chunkcache = None
416 415 self.defversion = REVLOG_DEFAULT_VERSION
417 416 if hasattr(opener, "defversion"):
@@ -891,8 +890,8 b' class revlog(object):'
891 890 """return an uncompressed revision of a given"""
892 891 if node == nullid:
893 892 return ""
894 if self.cache and self.cache[0] == node:
895 return self.cache[2]
893 if self._cache and self._cache[0] == node:
894 return self._cache[2]
896 895
897 896 # look up what we need to read
898 897 text = None
@@ -906,9 +905,9 b' class revlog(object):'
906 905 df = self.opener(self.datafile)
907 906
908 907 # do we have useful data cached?
909 if self.cache and self.cache[1] >= base and self.cache[1] < rev:
910 base = self.cache[1]
911 text = self.cache[2]
908 if self._cache and self._cache[1] >= base and self._cache[1] < rev:
909 base = self._cache[1]
910 text = self._cache[2]
912 911 self._loadindex(base, rev + 1)
913 912 else:
914 913 self._loadindex(base, rev + 1)
@@ -925,7 +924,7 b' class revlog(object):'
925 924 raise RevlogError(_("integrity check failed on %s:%d")
926 925 % (self.datafile, rev))
927 926
928 self.cache = (node, rev, text)
927 self._cache = (node, rev, text)
929 928 return text
930 929
931 930 def checkinlinesize(self, tr, fp=None):
@@ -1047,7 +1046,7 b' class revlog(object):'
1047 1046 ifh.write(data[1])
1048 1047 self.checkinlinesize(transaction, ifh)
1049 1048
1050 self.cache = (node, curr, text)
1049 self._cache = (node, curr, text)
1051 1050 return node
1052 1051
1053 1052 def ancestor(self, a, b):
@@ -1233,7 +1232,7 b' class revlog(object):'
1233 1232 indexf.truncate(end)
1234 1233
1235 1234 # then reset internal state in memory to forget those revisions
1236 self.cache = None
1235 self._cache = None
1237 1236 self._chunkcache = None
1238 1237 for x in xrange(rev, self.count()):
1239 1238 del self.nodemap[self.node(x)]
General Comments 0
You need to be logged in to leave comments. Login now