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: I3a2850fdc91f84bf24721972a709dae2f9a6183d
(cherry picked from commit bd8f658823059a4b5998bea283342f80ae94e4df)
diff --git a/project.py b/project.py
index 24816d0..a21f52f 100644
--- a/project.py
+++ b/project.py
@@ -179,6 +179,7 @@
auto_topic=False,
draft=False,
private=False,
+ notify=None,
wip=False,
dest_branch=None,
validate_certs=True,
@@ -188,6 +189,7 @@
auto_topic=auto_topic,
draft=draft,
private=private,
+ notify=notify,
wip=wip,
dest_branch=dest_branch,
validate_certs=validate_certs,
@@ -1118,6 +1120,7 @@
auto_topic=False,
draft=False,
private=False,
+ notify=None,
wip=False,
dest_branch=None,
validate_certs=True,
@@ -1174,6 +1177,8 @@
opts = ['r=%s' % p for p in people[0]]
opts += ['cc=%s' % p for p in people[1]]
+ if notify:
+ opts += ['notify=' + notify]
if private:
opts += ['private']
if wip: