Show More
@@ -238,14 +238,14 b' class revlog(object):' | |||||
238 | raise RevlogError(_('revlog chunk cache size %r is not a power ' |
|
238 | raise RevlogError(_('revlog chunk cache size %r is not a power ' | |
239 | 'of 2') % self._chunkcachesize) |
|
239 | 'of 2') % self._chunkcachesize) | |
240 |
|
240 | |||
241 | i = '' |
|
241 | indexdata = '' | |
242 | self._initempty = True |
|
242 | self._initempty = True | |
243 | try: |
|
243 | try: | |
244 | f = self.opener(self.indexfile) |
|
244 | f = self.opener(self.indexfile) | |
245 | i = f.read() |
|
245 | indexdata = f.read() | |
246 | f.close() |
|
246 | f.close() | |
247 | if len(i) > 0: |
|
247 | if len(indexdata) > 0: | |
248 | v = struct.unpack(versionformat, i[:4])[0] |
|
248 | v = struct.unpack(versionformat, indexdata[:4])[0] | |
249 | self._initempty = False |
|
249 | self._initempty = False | |
250 | except IOError as inst: |
|
250 | except IOError as inst: | |
251 | if inst.errno != errno.ENOENT: |
|
251 | if inst.errno != errno.ENOENT: | |
@@ -270,7 +270,7 b' class revlog(object):' | |||||
270 | if self.version == REVLOGV0: |
|
270 | if self.version == REVLOGV0: | |
271 | self._io = revlogoldio() |
|
271 | self._io = revlogoldio() | |
272 | try: |
|
272 | try: | |
273 | d = self._io.parseindex(i, self._inline) |
|
273 | d = self._io.parseindex(indexdata, self._inline) | |
274 | except (ValueError, IndexError): |
|
274 | except (ValueError, IndexError): | |
275 | raise RevlogError(_("index %s is corrupted") % (self.indexfile)) |
|
275 | raise RevlogError(_("index %s is corrupted") % (self.indexfile)) | |
276 | self.index, nodemap, self._chunkcache = d |
|
276 | self.index, nodemap, self._chunkcache = d |
General Comments 0
You need to be logged in to leave comments.
Login now