Commit 75e7872a authored by Aaron Gable's avatar Aaron Gable Committed by Commit Bot

Convert notify parameter inside gerrit_util

Bug: skia:6744
Change-Id: I0f84bd685bfacf692190f8636208122cf88d0b82
Reviewed-on: https://chromium-review.googlesource.com/529016Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
parent 354e1d23
......@@ -732,7 +732,7 @@ def SetReview(host, change, msg=None, labels=None, notify=None):
if labels:
body['labels'] = labels
if notify:
body['notify'] = notify
body['notify'] = 'ALL' if notify else 'NONE'
conn = CreateHttpConn(host, path, reqtype='POST', body=body)
response = ReadHttpJsonResponse(conn)
if labels:
......
......@@ -3105,8 +3105,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
print('Adding self-LGTM (Code-Review +1) because of TBRs.')
gerrit_util.SetReview(
self._GetGerritHost(), self.GetIssue(),
labels={'Code-Review': 1},
notify='ALL' if options.send_mail else 'NONE')
labels={'Code-Review': 1}, notify=bool(options.send_mail))
return 0
......@@ -3194,7 +3193,7 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
kwargs = {'labels': {'Commit-Queue': vote_map[new_state]}}
if new_state == _CQState.DRY_RUN:
# Don't spam everybody reviewer/owner.
kwargs['notify'] = 'NONE'
kwargs['notify'] = False
gerrit_util.SetReview(self._GetGerritHost(), self.GetIssue(), **kwargs)
def CannotTriggerTryJobReason(self):
......
......@@ -1581,8 +1581,7 @@ class TestGitCl(TestCase):
if tbr:
calls += [
(('SetReview', 'chromium-review.googlesource.com',
123456 if squash else None, {'Code-Review': 1},
'ALL' if notify else 'NONE'), ''),
123456 if squash else None, {'Code-Review': 1}, notify), ''),
]
calls += cls._git_post_upload_calls()
return calls
......@@ -2402,7 +2401,7 @@ class TestGitCl(TestCase):
self.assertEqual(0, git_cl.main(['set-commit', '-c']))
def test_cmd_set_commit_gerrit_dry(self):
self._cmd_set_commit_gerrit_common(1, notify='NONE')
self._cmd_set_commit_gerrit_common(1, notify=False)
self.assertEqual(0, git_cl.main(['set-commit', '-d']))
def test_cmd_set_commit_gerrit(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment