diff options
author | Simon Glass <sjg@chromium.org> | 2025-04-07 22:51:44 +1200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2025-05-27 10:07:41 +0100 |
commit | 7dc55435b2e869e26ab28926b92a7dc6620e2108 (patch) | |
tree | a1750ce867aa657ded6281331d45fb289cfa84e1 /tools/u_boot_pylib/gitutil.py | |
parent | e70fdbd7e49327d4db24e7b2208da87278070d73 (diff) |
patman: Pass the alias dict into gitutil.build_email_list()
Rather than accessing the settings module in this function, require the
alias dict to be passed in.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/u_boot_pylib/gitutil.py')
-rw-r--r-- | tools/u_boot_pylib/gitutil.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/u_boot_pylib/gitutil.py b/tools/u_boot_pylib/gitutil.py index 8935b6cc847..7c9d0deecbb 100644 --- a/tools/u_boot_pylib/gitutil.py +++ b/tools/u_boot_pylib/gitutil.py @@ -361,7 +361,7 @@ def create_patches(branch, start, count, ignore_binary, series, signoff=True): return None, files -def build_email_list(in_list, tag=None, alias=None, warn_on_error=True): +def build_email_list(in_list, alias, tag=None, warn_on_error=True): """Build a list of email addresses based on an input list. Takes a list of email addresses and aliases, and turns this into a list @@ -373,10 +373,10 @@ def build_email_list(in_list, tag=None, alias=None, warn_on_error=True): Args: in_list (list of str): List of aliases/email addresses - tag (str): Text to put before each address alias (dict): Alias dictionary: key: alias value: list of aliases or email addresses + tag (str): Text to put before each address warn_on_error (bool): True to raise an error when an alias fails to match, False to just print a message. @@ -389,12 +389,12 @@ def build_email_list(in_list, tag=None, alias=None, warn_on_error=True): >>> alias['mary'] = ['Mary Poppins <m.poppins@cloud.net>'] >>> alias['boys'] = ['fred', ' john'] >>> alias['all'] = ['fred ', 'john', ' mary '] - >>> build_email_list(['john', 'mary'], None, alias) + >>> build_email_list(['john', 'mary'], alias, None) ['j.bloggs@napier.co.nz', 'Mary Poppins <m.poppins@cloud.net>'] - >>> build_email_list(['john', 'mary'], '--to', alias) + >>> build_email_list(['john', 'mary'], alias, '--to') ['--to "j.bloggs@napier.co.nz"', \ '--to "Mary Poppins <m.poppins@cloud.net>"'] - >>> build_email_list(['john', 'mary'], 'Cc', alias) + >>> build_email_list(['john', 'mary'], alias, 'Cc') ['Cc j.bloggs@napier.co.nz', 'Cc Mary Poppins <m.poppins@cloud.net>'] """ quote = '"' if tag and tag[0] == '-' else '' @@ -498,7 +498,7 @@ send --cc-cmd cc-fname" cover p1 p2' # Restore argv[0] since we clobbered it. >>> sys.argv[0] = _old_argv0 """ - to = build_email_list(series.get('to'), '--to', alias, warn_on_error) + to = build_email_list(series.get('to'), settings.alias, '--to', warn_on_error) if not to: git_config_to = command.output('git', 'config', 'sendemail.to', raise_on_error=False) @@ -510,10 +510,10 @@ send --cc-cmd cc-fname" cover p1 p2' "git config sendemail.to u-boot@lists.denx.de") return None cc = build_email_list(list(set(series.get('cc')) - set(series.get('to'))), - '--cc', alias, warn_on_error) + settings.alias, '--cc', warn_on_error) if self_only: - to = build_email_list([os.getenv('USER')], '--to', - alias, warn_on_error) + to = build_email_list([os.getenv('USER')], '--to', settings.alias, + warn_on_error) cc = [] cmd = ['git', 'send-email', '--annotate'] if smtp_server: |