changeset 3352:0370c8503e2f

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