changeset 3351:a4edd014c166

firstmergecache: cleanup the update logic
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 21 Dec 2017 04:22:36 +0100
parents b98f9cd84581
children 0370c8503e2f
files hgext3rd/evolve/firstmergecache.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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