obscache: warm the cache in all cases
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 02 May 2017 16:15:01 +0200
changeset 2303 8534400111fd
parent 2302 acd2431dff29
child 2304 2f15090712fe
obscache: warm the cache in all cases There are case when the obsstore have been invalidated, but we still need to update the cache.
hgext3rd/evolve/obscache.py
--- a/hgext3rd/evolve/obscache.py	Tue May 02 16:11:43 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Tue May 02 16:15:01 2017 +0200
@@ -365,15 +365,14 @@
                 repo = reporef()
                 if repo is None:
                     return
-                if 'obsstore' in vars(self):
-                    repo = repo.unfiltered()
-                    # As pointed in 'obscache.update', we could have the
-                    # changelog and the obsstore in charge of updating the
-                    # cache when new items goes it. The tranaction logic would
-                    # then only be involved for the 'pending' and final saving
-                    # logic.
-                    self.obsstore.obscache.update(repo)
-                    self.obsstore.obscache.save(repo)
+                repo = repo.unfiltered()
+                # As pointed in 'obscache.update', we could have the
+                # changelog and the obsstore in charge of updating the
+                # cache when new items goes it. The tranaction logic would
+                # then only be involved for the 'pending' and final saving
+                # logic.
+                self.obsstore.obscache.update(repo)
+                self.obsstore.obscache.save(repo)
 
             tr.addpostclose('warmcache-obscache', _warmcache)
             return tr