# HG changeset patch # User Pierre-Yves David # Date 1495243902 -7200 # Node ID 62e4f9ff352baadc7b9f152029813bea55db148e # Parent 6a23a55f77d2d16e0d58985fa931e4360945943e 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. diff -r 6a23a55f77d2 -r 62e4f9ff352b README --- 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 ------------------- diff -r 6a23a55f77d2 -r 62e4f9ff352b hgext3rd/evolve/obsdiscovery.py --- 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: