|
|
@ -600,8 +600,9 @@ def DeletePendingChangeEdit(host, change):
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def SetCommitMessage(host, change, description):
|
|
|
|
def SetCommitMessage(host, change, description, notify='ALL'):
|
|
|
|
"""Updates a commit message."""
|
|
|
|
"""Updates a commit message."""
|
|
|
|
|
|
|
|
assert notify in ('ALL', 'NONE')
|
|
|
|
# First, edit the commit message in a draft.
|
|
|
|
# First, edit the commit message in a draft.
|
|
|
|
path = 'changes/%s/edit:message' % change
|
|
|
|
path = 'changes/%s/edit:message' % change
|
|
|
|
body = {'message': description}
|
|
|
|
body = {'message': description}
|
|
|
@ -619,7 +620,7 @@ def SetCommitMessage(host, change, description):
|
|
|
|
|
|
|
|
|
|
|
|
# And then publish it.
|
|
|
|
# And then publish it.
|
|
|
|
path = 'changes/%s/edit:publish' % change
|
|
|
|
path = 'changes/%s/edit:publish' % change
|
|
|
|
conn = CreateHttpConn(host, path, reqtype='POST', body={})
|
|
|
|
conn = CreateHttpConn(host, path, reqtype='POST', body={'notify': notify})
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
ReadHttpResponse(conn, ignore_404=False)
|
|
|
|
ReadHttpResponse(conn, ignore_404=False)
|
|
|
|
except GerritError as e:
|
|
|
|
except GerritError as e:
|
|
|
|