gerrit_util: add revision kwarg to SetReview

This will allow the caller to specify which revision to modify.

Bug: 378480632
Change-Id: I4cb184932f923d9bd43eb556097cb52029c185a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6012698
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
changes/98/6012698/2
Yiwei Zhang 1 year ago committed by LUCI CQ
parent 1063637350
commit ff14128b8a

@ -1671,11 +1671,17 @@ def AddReviewers(host,
accept_statuses=[200])
def SetReview(host, change, msg=None, labels=None, notify=None, ready=None):
def SetReview(host,
change,
revision='current',
msg=None,
labels=None,
notify=None,
ready=None):
"""Sets labels and/or adds a message to a code review."""
if not msg and not labels:
return
path = 'changes/%s/revisions/current/review' % change
path = f'changes/{change}/revisions/{revision}/review'
body: Dict[str, Any] = {'drafts': 'KEEP'}
if msg:
body['message'] = msg

Loading…
Cancel
Save