##// END OF EJS Templates
fncache: remove the rewriting logic...
Durham Goode -
r20879:cd03854a default
parent child Browse files
Show More
@@ -402,20 +402,13 b' class fncache(object):'
402 raise util.Abort(t)
402 raise util.Abort(t)
403 fp.close()
403 fp.close()
404
404
405 def _write(self, files, atomictemp):
406 fp = self.vfs('fncache', mode='wb', atomictemp=atomictemp)
407 if files:
408 fp.write(encodedir('\n'.join(files) + '\n'))
409 fp.close()
410 self._dirty = False
411
412 def rewrite(self, files):
413 self._write(files, False)
414 self.entries = set(files)
415
416 def write(self):
405 def write(self):
417 if self._dirty:
406 if self._dirty:
418 self._write(self.entries, True)
407 fp = self.vfs('fncache', mode='wb', atomictemp=True)
408 if self.entries:
409 fp.write(encodedir('\n'.join(self.entries) + '\n'))
410 fp.close()
411 self._dirty = False
419
412
420 def add(self, fn):
413 def add(self, fn):
421 if self.entries is None:
414 if self.entries is None:
@@ -476,7 +469,6 b' class fncachestore(basicstore):'
476 return self.rawvfs.stat(path).st_size
469 return self.rawvfs.stat(path).st_size
477
470
478 def datafiles(self):
471 def datafiles(self):
479 rewrite = False
480 existing = []
472 existing = []
481 for f in sorted(self.fncache):
473 for f in sorted(self.fncache):
482 ef = self.encode(f)
474 ef = self.encode(f)
@@ -486,12 +478,6 b' class fncachestore(basicstore):'
486 except OSError, err:
478 except OSError, err:
487 if err.errno != errno.ENOENT:
479 if err.errno != errno.ENOENT:
488 raise
480 raise
489 # nonexistent entry
490 rewrite = True
491 if rewrite:
492 # rewrite fncache to remove nonexistent entries
493 # (may be caused by rollback / strip)
494 self.fncache.rewrite(existing)
495
481
496 def copylist(self):
482 def copylist(self):
497 d = ('data dh fncache phaseroots obsstore'
483 d = ('data dh fncache phaseroots obsstore'
General Comments 0
You need to be logged in to leave comments. Login now