##// END OF EJS Templates
store: move logic to check for invalid entry in fncache to own function...
Pulkit Goyal -
r42139:d7ef84e5 default
parent child Browse files
Show More
@@ -464,13 +464,17 b' class fncache(object):'
464 self.entries = set()
464 self.entries = set()
465 return
465 return
466 self.entries = set(decodedir(fp.read()).splitlines())
466 self.entries = set(decodedir(fp.read()).splitlines())
467 self._checkentries(fp)
468 fp.close()
469
470 def _checkentries(self, fp):
471 """ make sure there is no empty string in entries """
467 if '' in self.entries:
472 if '' in self.entries:
468 fp.seek(0)
473 fp.seek(0)
469 for n, line in enumerate(util.iterfile(fp)):
474 for n, line in enumerate(util.iterfile(fp)):
470 if not line.rstrip('\n'):
475 if not line.rstrip('\n'):
471 t = _('invalid entry in fncache, line %d') % (n + 1)
476 t = _('invalid entry in fncache, line %d') % (n + 1)
472 raise error.Abort(t)
477 raise error.Abort(t)
473 fp.close()
474
478
475 def write(self, tr):
479 def write(self, tr):
476 if self._dirty:
480 if self._dirty:
General Comments 0
You need to be logged in to leave comments. Login now