# HG changeset patch # User Pierre-Yves David # Date 1494608834 -7200 # Node ID d5de0529a48f95a00cae40db224f01a8eff65bde # Parent 078549a71ce4476d926f1671e21f01f152d7680c obscache: extract the actual data update in a dedicated function This will help extract a data agnostic class. diff -r 078549a71ce4 -r d5de0529a48f hgext3rd/evolve/obscache.py --- 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