##// END OF EJS Templates
perf: start from an existing branchmap if possible...
Boris Feld -
r40807:58355a1d default
parent child Browse files
Show More
@@ -2347,8 +2347,22 b' def perfbranchmapupdate(ui, repo, base=('
2347 baserepo = repo.filtered(b'__perf_branchmap_update_base')
2347 baserepo = repo.filtered(b'__perf_branchmap_update_base')
2348 targetrepo = repo.filtered(b'__perf_branchmap_update_target')
2348 targetrepo = repo.filtered(b'__perf_branchmap_update_target')
2349
2349
2350 base = branchmap.branchcache()
2350 # try to find an existing branchmap to reuse
2351 base.update(baserepo, allbaserevs)
2351 subsettable = getbranchmapsubsettable()
2352 candidatefilter = subsettable.get(None)
2353 while candidatefilter is not None:
2354 candidatebm = repo.filtered(candidatefilter).branchmap()
2355 if candidatebm.validfor(baserepo):
2356 filtered = repoview.filterrevs(repo, candidatefilter)
2357 missing = [r for r in allbaserevs if r in filtered]
2358 base = candidatebm.copy()
2359 base.update(baserepo, missing)
2360 break
2361 candidatefilter = subsettable.get(candidatefilter)
2362 else:
2363 # no suitable subset where found
2364 base = branchmap.branchcache()
2365 base.update(baserepo, allbaserevs)
2352
2366
2353 def setup():
2367 def setup():
2354 x[0] = base.copy()
2368 x[0] = base.copy()
General Comments 0
You need to be logged in to leave comments. Login now