stablesort: cleanup the update logic
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 21 Dec 2017 04:23:45 +0100
changeset 3352 0370c8503e2f
parent 3351 a4edd014c166
child 3353 4635cef9624c
stablesort: cleanup the update logic
hgext3rd/evolve/stablesort.py
--- a/hgext3rd/evolve/stablesort.py	Thu Dec 21 04:22:36 2017 +0100
+++ b/hgext3rd/evolve/stablesort.py	Thu Dec 21 04:23:45 2017 +0100
@@ -671,9 +671,9 @@
         if util.safehasattr(repo, 'updatecaches'):
             @localrepo.unfilteredmethod
             def updatecaches(self, tr=None):
-                if utility.shouldwarmcache(repo):
-                    self.stablesort.update(repo)
-                    self.stablesort.save(repo)
+                if utility.shouldwarmcache(self):
+                    self.stablesort.update(self)
+                    self.stablesort.save(self)
                 super(stablesortrepo, self).updatecaches(tr)
 
         else:
@@ -686,8 +686,10 @@
                     if repo is None:
                         return
                     repo = repo.unfiltered()
+                    repo.stablesort.update(repo)
+                    repo.stablesort.save(repo)
 
-                if utility.shouldwarmcache(repo):
+                if utility.shouldwarmcache(self):
                     tr.addpostclose('warmcache-02stablesort', _warmcache)
                 return tr