# HG changeset patch # User Pierre-Yves David # Date 1494615639 -7200 # Node ID 4b8b7fd135eb73bcb95d367a61b8fc542a3f8ebc # Parent 9b68e65fad4f13c1bd3a7e51d398746662a2d7f3 obshashrange: warm cache outside of loops The performance impact will be lower diff -r 9b68e65fad4f -r 4b8b7fd135eb hgext3rd/evolve/obsdiscovery.py --- a/hgext3rd/evolve/obsdiscovery.py Fri May 12 21:20:02 2017 +0200 +++ b/hgext3rd/evolve/obsdiscovery.py Fri May 12 21:00:39 2017 +0200 @@ -242,6 +242,7 @@ entry = (h, 0) addentry(entry) + local.obsstore.rangeobshashcache.update(local) querycount = 0 ui.progress(_("comparing obsmarker with other"), querycount) overflow = [] @@ -343,6 +344,7 @@ linetemplate = '%12d %12s %12d %12d %12d %12s\n' headertemplate = linetemplate.replace('d', 's') ui.status(headertemplate % headers) + repo.obsstore.rangeobshashcache.update(repo) for r in ranges: d = (r[0], s(cl.node(r[0])), @@ -357,7 +359,6 @@ """return the obsolete hash associated to a range""" cache = repo.obsstore.rangeobshashcache cl = repo.changelog - cache.update(repo) obshash = cache.get(rangeid) if obshash is not None: return obshash @@ -634,6 +635,7 @@ if maxrev is not None: repo.stablerange.warmup(repo, upto=maxrev) result = [] + repo.obsstore.rangeobshashcache.update(repo) for r in ranges: if r[0] is None: result.append(node.wdirid)