mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
patman: Update Series.ShowActions() to pass alias
Instead of using settings.alias pass this value in. This allows tests to work without using settings.alias Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
abfd67cccf
commit
75ae217194
@ -237,7 +237,6 @@ class TestFunctional(unittest.TestCase):
|
||||
'fred': [self.fred],
|
||||
'joe': [self.joe],
|
||||
}
|
||||
settings.alias = alias
|
||||
|
||||
text = self._get_text('test01.txt')
|
||||
series = patchstream.get_metadata_for_test(text)
|
||||
@ -257,7 +256,7 @@ class TestFunctional(unittest.TestCase):
|
||||
cmd = gitutil.email_patches(
|
||||
series, cover_fname, args, dry_run, not ignore_bad_tags,
|
||||
cc_file, alias, in_reply_to=in_reply_to, thread=None)
|
||||
series.ShowActions(args, cmd, process_tags)
|
||||
series.ShowActions(args, cmd, process_tags, alias)
|
||||
cc_lines = open(cc_file, encoding='utf-8').read().splitlines()
|
||||
os.remove(cc_file)
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ def email_patches(col, series, cover_fname, patch_files, process_tags, its_a_go,
|
||||
|
||||
# For a dry run, just show our actions as a sanity check
|
||||
if dry_run:
|
||||
series.ShowActions(patch_files, cmd, process_tags)
|
||||
series.ShowActions(patch_files, cmd, process_tags, settings.alias)
|
||||
if not its_a_go:
|
||||
print(col.build(col.RED, "Email would not be sent"))
|
||||
|
||||
|
||||
@ -102,16 +102,19 @@ class Series(dict):
|
||||
commit.check_tags()
|
||||
self.commits.append(commit)
|
||||
|
||||
def ShowActions(self, args, cmd, process_tags):
|
||||
def ShowActions(self, args, cmd, process_tags, alias):
|
||||
"""Show what actions we will/would perform
|
||||
|
||||
Args:
|
||||
args: List of patch files we created
|
||||
cmd: The git command we would have run
|
||||
process_tags: Process tags as if they were aliases
|
||||
alias (dict): Alias dictionary
|
||||
key: alias
|
||||
value: list of aliases or email addresses
|
||||
"""
|
||||
to_set = set(gitutil.build_email_list(self.to, settings.alias));
|
||||
cc_set = set(gitutil.build_email_list(self.cc, settings.alias));
|
||||
to_set = set(gitutil.build_email_list(self.to, alias));
|
||||
cc_set = set(gitutil.build_email_list(self.cc, alias));
|
||||
|
||||
col = terminal.Color()
|
||||
print('Dry run, so not doing much. But I would do this:')
|
||||
@ -141,7 +144,7 @@ class Series(dict):
|
||||
if self.cover:
|
||||
print('Cover: %d lines' % len(self.cover))
|
||||
cover_cc = gitutil.build_email_list(self.get('cover_cc', ''),
|
||||
settings.alias)
|
||||
alias)
|
||||
all_ccs = itertools.chain(cover_cc, *self._generated_cc.values())
|
||||
for email in sorted(set(all_ccs) - to_set - cc_set):
|
||||
print(' Cc: ', email)
|
||||
@ -271,9 +274,9 @@ class Series(dict):
|
||||
"""
|
||||
cc = []
|
||||
if process_tags:
|
||||
cc += gitutil.build_email_list(commit.tags, settings.alias,
|
||||
cc += gitutil.build_email_list(commit.tags, alias,
|
||||
warn_on_error=warn_on_error)
|
||||
cc += gitutil.build_email_list(commit.cc_list, settings.alias,
|
||||
cc += gitutil.build_email_list(commit.cc_list, alias,
|
||||
warn_on_error=warn_on_error)
|
||||
if type(add_maintainers) == type(cc):
|
||||
cc += add_maintainers
|
||||
@ -353,7 +356,7 @@ class Series(dict):
|
||||
|
||||
if cover_fname:
|
||||
cover_cc = gitutil.build_email_list(
|
||||
self.get('cover_cc', ''), settings.alias)
|
||||
self.get('cover_cc', ''), alias)
|
||||
cover_cc = list(set(cover_cc + all_ccs))
|
||||
if limit is not None:
|
||||
cover_cc = cover_cc[:limit]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user