comparison contrib/perf.py @ 51553:f1512dbfee9f

perf-stream-consume: use the source repository config when applying This might contains critical configuration for the benchmark, like enabling of extensions like narrow.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 27 Mar 2024 18:51:33 +0000
parents f376c4d5c4b6
children 8e8776a28683
comparison
equal deleted inserted replaced
51552:15e680a44502 51553:f1512dbfee9f
2200 run_variables[1] = None 2200 run_variables[1] = None
2201 2201
2202 def runone(): 2202 def runone():
2203 bundle = run_variables[0] 2203 bundle = run_variables[0]
2204 tmp_dir = run_variables[1] 2204 tmp_dir = run_variables[1]
2205
2206 # we actually wants to copy all config to ensure the repo config is
2207 # taken in account during the benchmark
2208 new_ui = repo.ui.__class__(repo.ui)
2205 # only pass ui when no srcrepo 2209 # only pass ui when no srcrepo
2206 localrepo.createrepository( 2210 localrepo.createrepository(
2207 repo.ui, tmp_dir, requirements=repo.requirements 2211 new_ui, tmp_dir, requirements=repo.requirements
2208 ) 2212 )
2209 target = hg.repository(repo.ui, tmp_dir) 2213 target = hg.repository(new_ui, tmp_dir)
2210 gen = exchange.readbundle(target.ui, bundle, bundle.name) 2214 gen = exchange.readbundle(target.ui, bundle, bundle.name)
2211 # stream v1 2215 # stream v1
2212 if util.safehasattr(gen, 'apply'): 2216 if util.safehasattr(gen, 'apply'):
2213 gen.apply(target) 2217 gen.apply(target)
2214 else: 2218 else: