patman: Add a maintainer test feature to MakeCcFile()
Allow the add_maintainers parameter to be a list of maintainers, thus allowing us to simulate calling the script in tests without actually needing it to work. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
@@ -212,7 +212,9 @@ class Series(dict):
|
|||||||
cover_fname: If non-None the name of the cover letter.
|
cover_fname: If non-None the name of the cover letter.
|
||||||
raise_on_error: True to raise an error when an alias fails to match,
|
raise_on_error: True to raise an error when an alias fails to match,
|
||||||
False to just print a message.
|
False to just print a message.
|
||||||
add_maintainers: Call the get_maintainers to CC maintainers
|
add_maintainers: Either:
|
||||||
|
True/False to call the get_maintainers to CC maintainers
|
||||||
|
List of maintainers to include (for testing)
|
||||||
Return:
|
Return:
|
||||||
Filename of temp file created
|
Filename of temp file created
|
||||||
"""
|
"""
|
||||||
@@ -227,7 +229,9 @@ class Series(dict):
|
|||||||
raise_on_error=raise_on_error)
|
raise_on_error=raise_on_error)
|
||||||
list += gitutil.BuildEmailList(commit.cc_list,
|
list += gitutil.BuildEmailList(commit.cc_list,
|
||||||
raise_on_error=raise_on_error)
|
raise_on_error=raise_on_error)
|
||||||
if add_maintainers:
|
if type(add_maintainers) == type(list):
|
||||||
|
list += add_maintainers
|
||||||
|
elif add_maintainers:
|
||||||
list += get_maintainer.GetMaintainer(commit.patch)
|
list += get_maintainer.GetMaintainer(commit.patch)
|
||||||
list = [m.encode('utf-8') if type(m) != str else m for m in list]
|
list = [m.encode('utf-8') if type(m) != str else m for m in list]
|
||||||
all_ccs += list
|
all_ccs += list
|
||||||
|
|||||||
Reference in New Issue
Block a user