store: assert the fncache have been loaded if dirty
authorBoris Feld <boris.feld@octobus.net>
Sat, 14 Jul 2018 02:10:43 +0200
changeset 38696 89d93dd1a222
parent 38695 2cdb82e8fb44
child 38697 3c569172848d
store: assert the fncache have been loaded if dirty This should catch fncache corruption as the one that existed in `perffncachewrite`.
mercurial/store.py
--- a/mercurial/store.py	Sat Jul 14 02:09:47 2018 +0200
+++ b/mercurial/store.py	Sat Jul 14 02:10:43 2018 +0200
@@ -449,6 +449,7 @@
 
     def write(self, tr):
         if self._dirty:
+            assert self.entries is not None
             tr.addbackup('fncache')
             fp = self.vfs('fncache', mode='wb', atomictemp=True)
             if self.entries: