obscache: skip writing if the cache is empty
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 02 May 2017 16:19:05 +0200
changeset 2308 ef8beb602b41
parent 2307 0d2e0e8e76f6
child 2309 9f09cabe679e
obscache: skip writing if the cache is empty if the cache is empty, we can just skip writing to disk.
hgext3rd/evolve/obscache.py
--- a/hgext3rd/evolve/obscache.py	Tue May 02 16:17:03 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Tue May 02 16:19:05 2017 +0200
@@ -302,7 +302,7 @@
         """save the data to disk"""
 
         # XXX it happens that the obsstore is (buggilly) always up to date on disk
-        if self._cachekey is None:
+        if self._cachekey is None or self._cachekey == emptykey:
             return
 
         with repo.vfs(self._filepath, 'w', atomictemp=True) as cachefile: