obscache: extract the actual data update in a dedicated function
This will help extract a data agnostic class.
--- a/hgext3rd/evolve/obscache.py Fri May 12 19:05:46 2017 +0200
+++ b/hgext3rd/evolve/obscache.py Fri May 12 19:07:14 2017 +0200
@@ -285,10 +285,7 @@
if reset or self._cachekey is None:
self.clear(reset=True)
- if revs:
- self._updaterevs(repo, revs)
- if obsmarkers:
- self._updatemarkers(repo, obsmarkers)
+ def _updatefrom(repo, revs, obsmarkers)
# update the key from the new data
key = list(self._cachekey)
@@ -300,6 +297,12 @@
key[3], key[4] = obskeypair
self._cachekey = tuple(key)
+ def _updatefrom(self, repo, revs, obsmarkers):
+ if revs:
+ self._updaterevs(repo, revs)
+ if obsmarkers:
+ self._updatemarkers(repo, obsmarkers)
+
def _updaterevs(self, repo, revs):
"""update the cache with new revisions