mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-21 04:14:34 +00:00
patman: Run get_maintainer.pl in parallel
This script can take ages on some series. Try to limit the time by using threads. If a few stubborn patches remain, show progress so the user has some idea what is going on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
This commit is contained in:
parent
c524cd6139
commit
27409e35d5
2 changed files with 32 additions and 3 deletions
|
@ -240,6 +240,8 @@ class TestFunctional(unittest.TestCase):
|
||||||
self.assertEqual('Change log missing for v3', next(lines))
|
self.assertEqual('Change log missing for v3', next(lines))
|
||||||
self.assertEqual('Change log for unknown version v4', next(lines))
|
self.assertEqual('Change log for unknown version v4', next(lines))
|
||||||
self.assertEqual("Alias 'pci' not found", next(lines))
|
self.assertEqual("Alias 'pci' not found", next(lines))
|
||||||
|
while next(lines) != 'Cc processing complete':
|
||||||
|
pass
|
||||||
self.assertIn('Dry run', next(lines))
|
self.assertIn('Dry run', next(lines))
|
||||||
self.assertEqual('', next(lines))
|
self.assertEqual('', next(lines))
|
||||||
self.assertIn('Send a total of %d patches' % count, next(lines))
|
self.assertIn('Send a total of %d patches' % count, next(lines))
|
||||||
|
|
|
@ -5,8 +5,11 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
import concurrent.futures
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
|
||||||
from patman import get_maintainer
|
from patman import get_maintainer
|
||||||
from patman import gitutil
|
from patman import gitutil
|
||||||
|
@ -303,10 +306,34 @@ class Series(dict):
|
||||||
fd = open(fname, 'w', encoding='utf-8')
|
fd = open(fname, 'w', encoding='utf-8')
|
||||||
all_ccs = []
|
all_ccs = []
|
||||||
all_skips = set()
|
all_skips = set()
|
||||||
|
with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor:
|
||||||
|
for i, commit in enumerate(self.commits):
|
||||||
|
commit.seq = i
|
||||||
|
commit.future = executor.submit(
|
||||||
|
self.GetCcForCommit, commit, process_tags, warn_on_error,
|
||||||
|
add_maintainers, limit, get_maintainer_script, all_skips)
|
||||||
|
|
||||||
|
# Show progress any commits that are taking forever
|
||||||
|
lastlen = 0
|
||||||
|
while True:
|
||||||
|
left = [commit for commit in self.commits
|
||||||
|
if not commit.future.done()]
|
||||||
|
if not left:
|
||||||
|
break
|
||||||
|
names = ', '.join(f'{c.seq + 1}:{c.subject}'
|
||||||
|
for c in left[:2])
|
||||||
|
out = f'\r{len(left)} remaining: {names}'[:79]
|
||||||
|
spaces = ' ' * (lastlen - len(out))
|
||||||
|
if lastlen: # Don't print anything the first time
|
||||||
|
print(out, spaces, end='')
|
||||||
|
sys.stdout.flush()
|
||||||
|
lastlen = len(out)
|
||||||
|
time.sleep(.25)
|
||||||
|
print(f'\rdone{" " * lastlen}\r', end='')
|
||||||
|
print('Cc processing complete')
|
||||||
|
|
||||||
for commit in self.commits:
|
for commit in self.commits:
|
||||||
cc = self.GetCcForCommit(commit, process_tags, warn_on_error,
|
cc = commit.future.result()
|
||||||
add_maintainers, limit,
|
|
||||||
get_maintainer_script, all_skips)
|
|
||||||
all_ccs += cc
|
all_ccs += cc
|
||||||
print(commit.patch, '\0'.join(sorted(set(cc))), file=fd)
|
print(commit.patch, '\0'.join(sorted(set(cc))), file=fd)
|
||||||
self._generated_cc[commit.patch] = cc
|
self._generated_cc[commit.patch] = cc
|
||||||
|
|
Loading…
Add table
Reference in a new issue