From bd8f658823059a4b5998bea283342f80ae94e4df Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Wed, 31 Oct 2018 13:48:01 -0700 Subject: 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 --- subcmds/upload.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'subcmds/upload.py') 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/ p.add_option('-d', '--draft', action='store_true', dest='draft', default=False, help='If specified, upload as a draft.') + p.add_option('--ne', '--no-emails', + action='store_false', dest='notify', default=True, + help='If specified, do not send emails on upload.') p.add_option('-p', '--private', action='store_true', dest='private', default=False, help='If specified, upload as a private change.') @@ -391,6 +394,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ auto_topic=opt.auto_topic, draft=opt.draft, private=opt.private, + notify=None if opt.notify else 'NONE', wip=opt.wip, dest_branch=destination, validate_certs=opt.validate_certs, -- cgit v1.2.3-54-g00ecf