Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Unified Diff: gerrit_util.py

Issue 2376323002: Reland of Add CC_LIST and --cc to Gerrit issues via API to be similar to CCs in Rietveld (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | git_cl.py » ('j') | git_cl.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gerrit_util.py
diff --git a/gerrit_util.py b/gerrit_util.py
index 011606f652fd7e6dc961057d6d4b89aa1dad6aa8..7cab2a5c85e56fc9a93664ea0a8bb3b81f7cfab6 100755
--- a/gerrit_util.py
+++ b/gerrit_util.py
@@ -613,7 +613,7 @@ def GetReview(host, change, revision):
return ReadHttpJsonResponse(CreateHttpConn(host, path))
-def AddReviewers(host, change, add=None):
+def AddReviewers(host, change, add=None, is_reviewer=True):
"""Add reviewers to a change."""
if not add:
return
@@ -621,7 +621,10 @@ def AddReviewers(host, change, add=None):
add = (add,)
path = 'changes/%s/reviewers' % change
for r in add:
- body = {'reviewer': r}
+ body = {
+ 'reviewer': r,
+ 'state': 'REVIEWER' if is_reviewer else 'CC',
+ }
conn = CreateHttpConn(host, path, reqtype='POST', body=body)
jmsg = ReadHttpJsonResponse(conn, ignore_404=False)
return jmsg
« no previous file with comments | « no previous file | git_cl.py » ('j') | git_cl.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698