# HG changeset patch # User Pierre-Yves David # Date 1534445395 -7200 # Node ID b53bf9942e0af8ec9bd460b4a4f31600ec77547b # Parent 2174de498a69e2fe92112e9f1bcde75d80806452 obshashrange: do not search for affected stable range cache is unavailable Before this changeset we where resetting in all cases, and then looking for affected ranges. In addition is the stable range were not available, the functions silently returned no ranges affected. Now, do one or the other depending of the availability of the stable range cache. In practice we always do a broad reset because the code detecting affected changeset is currently buggy. diff -r 2174de498a69 -r b53bf9942e0a hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Thu Aug 16 20:22:19 2018 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Thu Aug 16 20:49:55 2018 +0200 @@ -436,14 +436,15 @@ repo.ui.log('evoext-cache', 'obshashcache clean - ' 'new markers affect %d changeset and cached ranges\n' % len(affected)) - # XXX the current reset is too strong we could just drop the affected range con = self._con if con is not None: - con.execute(_reset) - - ranges = repo.stablerange.contains(repo, affected) - - con.executemany(_delete, ranges) + # always reset for now, the code detecting affect is buggy so + # we need to reset more broadly than we would like. + if True or repo.stablerange._con is None: + con.execute(_reset) + else: + ranges = repo.stablerange.contains(repo, affected) + con.executemany(_delete, ranges) # rewarm key revisions # diff -r 2174de498a69 -r b53bf9942e0a hgext3rd/evolve/stablerangecache.py --- a/hgext3rd/evolve/stablerangecache.py Thu Aug 16 20:22:19 2018 +0200 +++ b/hgext3rd/evolve/stablerangecache.py Thu Aug 16 20:49:55 2018 +0200 @@ -151,15 +151,15 @@ self._unsavedsubranges = {} def contains(self, repo, revs): + con = self._con + assert con is not None new = set() known = set() depth = repo.depthcache.get for r in revs: new.add((r, depth(r) - 1)) new.add((r, 0)) - con = self._con - while new and con is not None: - new + while new: if len(new) < 300: sample = new else: