# HG changeset patch # User Pierre-Yves David # Date 1495121736 -7200 # Node ID 8df32538f662429a7fe2694d23e41c170b7982d4 # Parent bd937b7ce7d23cda37c055dee82a8d62b1ab9cf2 obshashrangecache: precisely track affected revs when adding new markers This will be useful when we start doing finer grained invalidation (instead of dropping all data). diff -r bd937b7ce7d2 -r 8df32538f662 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Thu May 18 14:58:22 2017 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Thu May 18 17:35:36 2017 +0200 @@ -491,6 +491,7 @@ rev = repo.changelog.nodemap.get # if we have a new markers affecting a node already covered by the # cache, we must abort. + affected = set() for m in obsmarkers: # check successors and parent for l in (m[1], m[5]): @@ -499,18 +500,15 @@ for p in l: r = rev(p) if r is not None and r not in setrevs: - repo.ui.log('evoext-cache', 'obshashcache reset - ' - 'new markers affect cached ranges\n') - con = self._con - if con is not None: - con.execute(_reset) - break - else: - continue - break - else: - continue - break + # XXX should check < min(setrevs) or tiprevs + affected.add(r) + + if affected: + repo.ui.log('evoext-cache', 'obshashcache reset - ' + 'new markers affect cached ranges\n') + con = self._con + if con is not None: + con.execute(_reset) # XXX the current reset is too strong we could just drop the affected range