firstmergecache: cleanup the update logic
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 04:22:36 +0100
changeset 3351 a4edd014c166
parent 3350 b98f9cd84581
child 3352 0370c8503e2f
firstmergecache: cleanup the update logic
hgext3rd/evolve/firstmergecache.py
--- a/hgext3rd/evolve/firstmergecache.py	Thu Dec 21 04:21:53 2017 +0100
+++ b/hgext3rd/evolve/firstmergecache.py	Thu Dec 21 04:22:36 2017 +0100
@@ -40,9 +40,9 @@
         if util.safehasattr(repo, 'updatecaches'):
             @localrepo.unfilteredmethod
             def updatecaches(self, tr=None):
-                if utility.shouldwarmcache(repo):
-                    self.firstmergecache.update(repo)
-                    self.firstmergecache.save(repo)
+                if utility.shouldwarmcache(self):
+                    self.firstmergecache.update(self)
+                    self.firstmergecache.save(self)
                 super(firstmergecacherepo, self).updatecaches(tr)
 
         else:
@@ -55,10 +55,10 @@
                     if repo is None:
                         return
                     repo = repo.unfiltered()
-                    self.firstmergecache.update(repo)
-                    self.firstmergecache.save(repo)
+                    repo.firstmergecache.update(repo)
+                    repo.firstmergecache.save(repo)
 
-                if utility.shouldwarmcache(repo):
+                if utility.shouldwarmcache(self):
                     tr.addpostclose('warmcache-01-firstparentcache', _warmcache)
                 return tr