summaryrefslogtreecommitdiff
path: root/tools/patman/gitutil.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-19 09:56:07 -0600
committerSimon Glass <sjg@chromium.org>2018-06-23 08:03:43 -0600
commita60aedfd31722f835dc834f9f2f60882beb96991 (patch)
tree2317644f1ff2173cd8fc9f8c6b0449e70a86b249 /tools/patman/gitutil.py
parentfe6ef1e9bacac98747e8b88d6a7f786db511a8d6 (diff)
patman: Support using a particular SMTP server
Some environments require providing the '--smtp-server' argument to 'git send-email'. Add support for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/gitutil.py')
-rw-r--r--tools/patman/gitutil.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index 64ac0c8d3d..9905bb0bbd 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -332,7 +332,8 @@ def BuildEmailList(in_list, tag=None, alias=None, raise_on_error=True):
return result
def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
- self_only=False, alias=None, in_reply_to=None, thread=False):
+ self_only=False, alias=None, in_reply_to=None, thread=False,
+ smtp_server=None):
"""Email a patch series.
Args:
@@ -348,6 +349,7 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
Should be a message ID that this is in reply to.
thread: True to add --thread to git send-email (make
all patches reply to cover-letter or first patch in series)
+ smtp_server: SMTP server to use to send patches
Returns:
Git command that was/would be run
@@ -405,6 +407,8 @@ def EmailPatches(series, cover_fname, args, dry_run, raise_on_error, cc_fname,
to = BuildEmailList([os.getenv('USER')], '--to', alias, raise_on_error)
cc = []
cmd = ['git', 'send-email', '--annotate']
+ if smtp_server:
+ cmd.append('--smtp-server=%s' % smtp_server)
if in_reply_to:
if type(in_reply_to) != str:
in_reply_to = in_reply_to.encode('utf-8')