hgext/remotefilelog/basestore.py
changeset 44101 25097b4d2c6f
parent 44062 2d49482d0dd4
child 45942 89a2afe31e82
equal deleted inserted replaced
44100:969527ac7b44 44101:25097b4d2c6f
   223         filepath = self._getfilepath(name, node)
   223         filepath = self._getfilepath(name, node)
   224         try:
   224         try:
   225             data = shallowutil.readfile(filepath)
   225             data = shallowutil.readfile(filepath)
   226             if self._validatecache and not self._validatedata(data, filepath):
   226             if self._validatecache and not self._validatedata(data, filepath):
   227                 if self._validatecachelog:
   227                 if self._validatecachelog:
   228                     with open(self._validatecachelog, b'a+') as f:
   228                     with open(self._validatecachelog, b'ab+') as f:
   229                         f.write(b"corrupt %s during read\n" % filepath)
   229                         f.write(b"corrupt %s during read\n" % filepath)
   230                 os.rename(filepath, filepath + b".corrupt")
   230                 os.rename(filepath, filepath + b".corrupt")
   231                 raise KeyError(b"corrupt local cache file %s" % filepath)
   231                 raise KeyError(b"corrupt local cache file %s" % filepath)
   232         except IOError:
   232         except IOError:
   233             raise KeyError(
   233             raise KeyError(