##// END OF EJS Templates
revlog/parseindex: no need to pass the file around
Benoit Boissinot -
r13264:8439526f default
parent child Browse files
Show More
@@ -126,7 +126,7 b' class revlogoldio(object):'
126 def __init__(self):
126 def __init__(self):
127 self.size = struct.calcsize(indexformatv0)
127 self.size = struct.calcsize(indexformatv0)
128
128
129 def parseindex(self, fp, data, inline):
129 def parseindex(self, data, inline):
130 s = self.size
130 s = self.size
131 index = []
131 index = []
132 nodemap = {nullid: nullrev}
132 nodemap = {nullid: nullrev}
@@ -170,7 +170,7 b' class revlogio(object):'
170 def __init__(self):
170 def __init__(self):
171 self.size = struct.calcsize(indexformatng)
171 self.size = struct.calcsize(indexformatng)
172
172
173 def parseindex(self, fp, data, inline):
173 def parseindex(self, data, inline):
174 # call the C implementation to parse the index data
174 # call the C implementation to parse the index data
175 index, cache = parsers.parse_index2(data, inline)
175 index, cache = parsers.parse_index2(data, inline)
176 return index, None, cache
176 return index, None, cache
@@ -264,7 +264,7 b' class revlog(object):'
264 self._io = revlogoldio()
264 self._io = revlogoldio()
265 if i:
265 if i:
266 try:
266 try:
267 d = self._io.parseindex(f, i, self._inline)
267 d = self._io.parseindex(i, self._inline)
268 except (ValueError, IndexError):
268 except (ValueError, IndexError):
269 raise RevlogError(_("index %s is corrupted") % (self.indexfile))
269 raise RevlogError(_("index %s is corrupted") % (self.indexfile))
270 self.index, n, self._chunkcache = d
270 self.index, n, self._chunkcache = d
General Comments 0
You need to be logged in to leave comments. Login now