##// END OF EJS Templates
fix: prefetch file contents...
Rodrigo Damazio Bovendorp -
r45634:797ef6f8 default
parent child Browse files
Show More
@@ -271,6 +271,11 b' def fix(ui, repo, *pats, **opts):'
271 basepaths = getbasepaths(repo, opts, workqueue, basectxs)
271 basepaths = getbasepaths(repo, opts, workqueue, basectxs)
272 fixers = getfixers(ui)
272 fixers = getfixers(ui)
273
273
274 # Rather than letting each worker independently fetch the files
275 # (which also would add complications for shared/keepalive
276 # connections), prefetch them all first.
277 _prefetchfiles(repo, workqueue, basepaths)
278
274 # There are no data dependencies between the workers fixing each file
279 # There are no data dependencies between the workers fixing each file
275 # revision, so we can use all available parallelism.
280 # revision, so we can use all available parallelism.
276 def getfixes(items):
281 def getfixes(items):
@@ -630,6 +635,29 b' def getbasectxs(repo, opts, revstofix):'
630 return basectxs
635 return basectxs
631
636
632
637
638 def _prefetchfiles(repo, workqueue, basepaths):
639 toprefetch = set()
640
641 # Prefetch the files that will be fixed.
642 for rev, path in workqueue:
643 if rev == wdirrev:
644 continue
645 toprefetch.add((rev, path))
646
647 # Prefetch the base contents for lineranges().
648 for (baserev, fixrev, path), basepath in basepaths.items():
649 toprefetch.add((baserev, basepath))
650
651 if toprefetch:
652 scmutil.prefetchfiles(
653 repo,
654 [
655 (rev, scmutil.matchfiles(repo, [path]))
656 for rev, path in toprefetch
657 ],
658 )
659
660
633 def fixfile(ui, repo, opts, fixers, fixctx, path, basepaths, basectxs):
661 def fixfile(ui, repo, opts, fixers, fixctx, path, basepaths, basectxs):
634 """Run any configured fixers that should affect the file in this context
662 """Run any configured fixers that should affect the file in this context
635
663
General Comments 0
You need to be logged in to leave comments. Login now