obscache: use the smaller scope function
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 11 May 2017 16:06:31 +0200
changeset 2344 827d0f0a483f
parent 2343 37749a3cd3d1
child 2345 406c1a57b4ee
obscache: use the smaller scope function This make the function simpler and allow larger update on the 'upgradeneeded' one.
hgext3rd/evolve/obscache.py
--- a/hgext3rd/evolve/obscache.py	Thu May 11 16:05:50 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Thu May 11 16:06:31 2017 +0200
@@ -242,8 +242,10 @@
     def uptodate(self, repo):
         if self._cachekey is None:
             self.load(repo)
-        valid, startrev, startidx = upgradeneeded(repo, self._cachekey)
-        return (valid and startrev is None and startidx is None)
+        status = _checkkey(repo, self._cachekey)
+        return (status is not None
+                and status[0] == self._cachekey[0] # tiprev
+                and status[1] == self._cachekey[3]) # obssize
 
     def update(self, repo):
         """Iteratively update the cache with new repository data"""