changeset 2307:0d2e0e8e76f6

obscache: set a valid "empty" cache key if the cache is missing This avoid detecting bad cache when it just happens to be no cache.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 02 May 2017 16:17:03 +0200
parents b33bc2f37e89
children ef8beb602b41
files hgext3rd/evolve/obscache.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obscache.py	Tue May 02 16:10:14 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Tue May 02 16:17:03 2017 +0200
@@ -82,6 +82,8 @@
 
     return obsstore
 
+emptykey = (node.nullrev, node.nullid, 0, 0, node.nullid)
+
 def getcachekey(repo):
     """get a cache key covering the changesets and obsmarkers content
 
@@ -314,6 +316,7 @@
 
         data = repo.vfs.tryread(self._filepath)
         if not data:
+            self._cachekey = emptykey
             return
 
         headersize = struct.calcsize(self._headerformat)