obshashrange: re-warm less revision after reset
rewarming every single revision get very expensive quickly. Instead we warm few
key revision and rely on the fact this will warm enough useful subrange.
--- a/README Fri May 19 17:34:45 2017 +0200
+++ b/README Sat May 20 03:31:42 2017 +0200
@@ -115,8 +115,9 @@
6.2.1 - in progress
-------------------
-- prune: fix a crash related to color handling,
-- next: fix a crash related to color handling,
+ - prune: fix a crash related to color handling,
+ - next: fix a crash related to color handling,
+ - cache: reduce the warming load in case of reset,
6.2.0 -- 2017-05-18
-------------------
--- a/hgext3rd/evolve/obsdiscovery.py Fri May 19 17:34:45 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py Sat May 20 03:31:42 2017 +0200
@@ -523,12 +523,17 @@
con = self._con
if con is not None:
con.execute(_reset)
- # rewarm the whole cache
+ # rewarm key revisions
+ #
+ # (The current invalidation is too wide, but rewarming every single
+ # revision is quite costly)
+ newrevs = []
stop = self._cachekey[0] # tiprev
- if revs:
- stop = max(revs)
- if 0 <= stop:
- revs = repo.changelog.revs(stop=stop)
+ for h in repo.filtered('immutable').changelog.headrevs():
+ if h <= stop:
+ newrevs.append(h)
+ newrevs.extend(revs)
+ revs = newrevs
# warm the cache for the new revs
for r in revs: