mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[git cl split] Make Emit and EmitWarning variadic
This better matches the print function which they replace, and prevents errors from passing the wrong number of arguments. We also change printing in one function to be more user-friendly. Bug: 389069356 Change-Id: Ia41d256b441bffa063f5d0b5ab4eb20725aaeaf4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6322690 Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Devon Loehr <dloehr@google.com>
This commit is contained in:
13
split_cl.py
13
split_cl.py
@@ -30,12 +30,13 @@ CL_SPLIT_FORCE_LIMIT = 10
|
||||
CL_SPLIT_TOP_REVIEWERS = 5
|
||||
|
||||
|
||||
def Emit(msg: str):
|
||||
def Emit(*msg: str):
|
||||
"""Wrapper for easier mocking during tests"""
|
||||
print(msg)
|
||||
print(*msg)
|
||||
|
||||
def EmitWarning(msg: str):
|
||||
print("Warning: ", msg)
|
||||
|
||||
def EmitWarning(*msg: str):
|
||||
print("Warning: ", *msg)
|
||||
|
||||
|
||||
def HashList(lst: List[Any]) -> str:
|
||||
@@ -736,7 +737,9 @@ def ValidateSplitting(cl_infos: List[CLInfo], filename: str,
|
||||
if (unmentioned_files):
|
||||
EmitWarning(
|
||||
"the following files are not included in any CL in {filename}. "
|
||||
"They will not be uploaded:\n", unmentioned_files)
|
||||
"They will not be uploaded:")
|
||||
for file in unmentioned_files:
|
||||
Emit(file)
|
||||
|
||||
|
||||
def LoadSplittingFromFile(filename: str,
|
||||
|
||||
Reference in New Issue
Block a user