depthcache: cleanup the update logic
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 04:21:53 +0100
changeset 3350 b98f9cd84581
parent 3349 0539070016b0
child 3351 a4edd014c166
depthcache: cleanup the update logic
hgext3rd/evolve/depthcache.py
--- a/hgext3rd/evolve/depthcache.py	Thu Dec 21 04:12:02 2017 +0100
+++ b/hgext3rd/evolve/depthcache.py	Thu Dec 21 04:21:53 2017 +0100
@@ -78,9 +78,9 @@
         if util.safehasattr(repo, 'updatecaches'):
             @localrepo.unfilteredmethod
             def updatecaches(self, tr=None):
-                if utility.shouldwarmcache(repo):
-                    self.depthcache.update(repo)
-                    self.depthcache.save(repo)
+                if utility.shouldwarmcache(self):
+                    self.depthcache.update(self)
+                    self.depthcache.save(self)
                 super(depthcacherepo, self).updatecaches(tr)
 
         else:
@@ -93,8 +93,10 @@
                     if repo is None:
                         return
                     repo = repo.unfiltered()
+                    repo.depthcache.update(repo)
+                    repo.depthcache.save(repo)
 
-                if utility.shouldwarmcache(repo):
+                if utility.shouldwarmcache(self):
                     tr.addpostclose('warmcache-00depthcache', _warmcache)
                 return tr