hgext3rd/evolve/obscache.py
changeset 2308 ef8beb602b41
parent 2307 0d2e0e8e76f6
child 2309 9f09cabe679e
equal deleted inserted replaced
2307:0d2e0e8e76f6 2308:ef8beb602b41
   300 
   300 
   301     def save(self, repo):
   301     def save(self, repo):
   302         """save the data to disk"""
   302         """save the data to disk"""
   303 
   303 
   304         # XXX it happens that the obsstore is (buggilly) always up to date on disk
   304         # XXX it happens that the obsstore is (buggilly) always up to date on disk
   305         if self._cachekey is None:
   305         if self._cachekey is None or self._cachekey == emptykey:
   306             return
   306             return
   307 
   307 
   308         with repo.vfs(self._filepath, 'w', atomictemp=True) as cachefile:
   308         with repo.vfs(self._filepath, 'w', atomictemp=True) as cachefile:
   309             headerdata = struct.pack(self._headerformat, *self._cachekey)
   309             headerdata = struct.pack(self._headerformat, *self._cachekey)
   310             cachefile.write(headerdata)
   310             cachefile.write(headerdata)