# HG changeset patch # User Pierre-Yves David # Date 1495122479 -7200 # Node ID 22fb71a2d865f1ba0c38431bf418ebac4ded1c1d # Parent 8df32538f662429a7fe2694d23e41c170b7982d4 obshashrangecache: make sure we re-warm the cache after a reset This will "mitigate" the effect of dropping existing entries when new markers affect existing range. diff -r 8df32538f662 -r 22fb71a2d865 README --- a/README Thu May 18 17:35:36 2017 +0200 +++ b/README Thu May 18 17:47:59 2017 +0200 @@ -121,7 +121,7 @@ markers without changesets - obshashrange-cache: update incrementally in the (common) case of a transaction not affecting existing range, - - obshashrange-cache: keep the cache mostly warm after each transaction, + - obshashrange-cache: keep the cache warm after each transaction, - blackbox: log more information about discovery and cache computation. 6.1.1 - in progress diff -r 8df32538f662 -r 22fb71a2d865 hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Thu May 18 17:35:36 2017 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Thu May 18 17:47:59 2017 +0200 @@ -506,13 +506,16 @@ if affected: repo.ui.log('evoext-cache', 'obshashcache reset - ' 'new markers affect cached ranges\n') + # 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) - - # XXX the current reset is too strong we could just drop the affected range - - # XXX if we reset, we should warm the cache for existing heads (draft and public) + # rewarm the whole cache + stop = self._cachekey[0] # tiprev + if revs: + stop = max(revs) + if 0 <= stop: + revs = repo.changelog.revs(stop=stop) # warm the cache for the new revs for r in revs: