subranges: add a utility function to set the cache
This is preparing on disk persistence for the value in this cache.
--- a/hgext3rd/evolve/stablerange.py Fri Mar 24 09:18:50 2017 +0100
+++ b/hgext3rd/evolve/stablerange.py Fri Mar 24 09:21:05 2017 +0100
@@ -264,7 +264,7 @@
if cached is not None:
return cached
value = self._subranges(repo, rangeid)
- self._subrangescache[rangeid] = value
+ self._setsub(rangeid, value)
return value
def revsfromrange(self, repo, rangeid):
@@ -316,6 +316,12 @@
This mostly exist to help the on disk persistence"""
return self._subrangescache.get(rev)
+ def _setsub(self, rev, value):
+ """utility function used to set the subranges cache
+
+ This mostly exist to help the on disk persistence."""
+ self._subrangescache[rev] = value
+
def _filestablesortcache(self, sortedrevs, merge):
if merge not in self._stablesortprepared:
self._stablesortprepared[merge] = (sortedrevs, len(sortedrevs))