summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2018-10-31 13:48:01 -0700
committerVadim Bendebury <vbendeb@google.com>2018-11-05 14:01:05 -0800
commitbd8f658823059a4b5998bea283342f80ae94e4df (patch)
treeea6ce3a06b93903f7e2ba5d139bab2c3399f179a /subcmds/upload.py
parent713c5872fb54c8094c0f5fa1523388efd81517cc (diff)
downloadgit-repo-bd8f658823059a4b5998bea283342f80ae94e4df.tar.gz
Add option for git-repo to support 'silent' uploads
When --ne/--no-emails is added to 'repo upload' command line, gerrit server will not generate notification emails. project.py:Project.UploadForReview method is modified to accept a string recognizable by gerrit to indicate different sets of destination email addressees, but the upload command line allows only one option - disable sending emails completely. Default repo upload behavior is not being changed. TEST=tried in the Chrome OS repo, observed that patches uploaded with --ne or --no-emails indeed do not trigger any emails, while patches uploaded without these command line options still trigger email notifications. Change-Id: I0301edec984907aedac277d883bd0e6d3099aedc
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r--subcmds/upload.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 02b43b40..acb9d7f0 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -150,6 +150,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/
150 p.add_option('-d', '--draft', 150 p.add_option('-d', '--draft',
151 action='store_true', dest='draft', default=False, 151 action='store_true', dest='draft', default=False,
152 help='If specified, upload as a draft.') 152 help='If specified, upload as a draft.')
153 p.add_option('--ne', '--no-emails',
154 action='store_false', dest='notify', default=True,
155 help='If specified, do not send emails on upload.')
153 p.add_option('-p', '--private', 156 p.add_option('-p', '--private',
154 action='store_true', dest='private', default=False, 157 action='store_true', dest='private', default=False,
155 help='If specified, upload as a private change.') 158 help='If specified, upload as a private change.')
@@ -391,6 +394,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
391 auto_topic=opt.auto_topic, 394 auto_topic=opt.auto_topic,
392 draft=opt.draft, 395 draft=opt.draft,
393 private=opt.private, 396 private=opt.private,
397 notify=None if opt.notify else 'NONE',
394 wip=opt.wip, 398 wip=opt.wip,
395 dest_branch=destination, 399 dest_branch=destination,
396 validate_certs=opt.validate_certs, 400 validate_certs=opt.validate_certs,