stablerange: cleanup the update logic
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 04:24:37 +0100
changeset 3353 4635cef9624c
parent 3352 0370c8503e2f
child 3354 32e7ceaf1d82
stablerange: cleanup the update logic
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/stablerangecache.py	Thu Dec 21 04:23:45 2017 +0100
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Dec 21 04:24:37 2017 +0100
@@ -336,9 +336,9 @@
         if util.safehasattr(repo, 'updatecaches'):
             @localrepo.unfilteredmethod
             def updatecaches(self, tr=None):
-                if utility.shouldwarmcache(repo):
-                    self.stablerange.update(repo)
-                    self.stablerange.save(repo)
+                if utility.shouldwarmcache(self):
+                    self.stablerange.update(self)
+                    self.stablerange.save(self)
                 super(stablerangerepo, self).updatecaches(tr)
 
         else:
@@ -354,7 +354,7 @@
                     repo.stablerange.update(repo)
                     repo.stablerange.save(repo)
 
-                if utility.shouldwarmcache(repo):
+                if utility.shouldwarmcache(self):
                     tr.addpostclose('warmcache-10stablerange', _warmcache)
                 return tr