Show More
@@ -271,6 +271,11 b' def fix(ui, repo, *pats, **opts):' | |||
|
271 | 271 | basepaths = getbasepaths(repo, opts, workqueue, basectxs) |
|
272 | 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 | 279 | # There are no data dependencies between the workers fixing each file |
|
275 | 280 | # revision, so we can use all available parallelism. |
|
276 | 281 | def getfixes(items): |
@@ -630,6 +635,24 b' def getbasectxs(repo, opts, revstofix):' | |||
|
630 | 635 | basectxs[rev].add(pctx) |
|
631 | 636 | return basectxs |
|
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(repo, [ | |
|
653 | (rev, scmutil.matchfiles(repo, [path])) for rev, path in toprefetch | |
|
654 | ]) | |
|
655 | ||
|
633 | 656 | |
|
634 | 657 | def fixfile(ui, repo, opts, fixers, fixctx, path, basepaths, basectxs): |
|
635 | 658 | """Run any configured fixers that should affect the file in this context |
General Comments 0
You need to be logged in to leave comments.
Login now