Commit 56d0de79 authored by hinoka@chromium.org's avatar hinoka@chromium.org

Revert of Make `git cl description` work for Gerrit (patchset #2 id:20001 of...

Revert of Make `git cl description` work for Gerrit (patchset #2 id:20001 of https://codereview.chromium.org/1917473002/ )

Reason for revert:
Broke presubmit

Original issue's description:
> Make `git cl description` work for Gerrit
> 
> This works in that it actually changes the description, but after
> multiple changes, there's multiple footers added. I'm not sure if they
> should be stripped in setting the description? Or is the problem in
> FetchDescription() where it shouldn't be returning
> 'commit_with_footers', but rather something else?
> 
> Example change at https://chromium-review.googlesource.com/c/340430/.
> 
> R=tandrii@chromium.org
> BUG=603207
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=300169

TBR=tandrii@chromium.org,scottmg@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=603207

Review URL: https://codereview.chromium.org/1922733002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300175 0039d316-1c4b-4281-b951-d872f2087c98
parent 4d038b43
...@@ -541,38 +541,6 @@ def SubmitChange(host, change, wait_for_merge=True): ...@@ -541,38 +541,6 @@ def SubmitChange(host, change, wait_for_merge=True):
return ReadHttpJsonResponse(conn, ignore_404=False) return ReadHttpJsonResponse(conn, ignore_404=False)
def SetCommitMessage(host, change, description):
"""Updates a commit message."""
# First, edit the commit message in a draft.
path = 'changes/%s/edit:message' % change
body = {'message': description}
conn = CreateHttpConn(host, path, reqtype='PUT', body=body)
try:
ReadHttpResponse(conn, ignore_404=False)
except GerritError as e:
# On success, gerrit returns status 204; anything else is an error.
if e.http_status != 204:
raise
else:
raise GerritError(
'Unexpectedly received a 200 http status while editing message in '
'change %s' % change)
# And then publish it.
path = 'changes/%s/edit:publish' % change
conn = CreateHttpConn(host, path, reqtype='POST', body={})
try:
ReadHttpResponse(conn, ignore_404=False)
except GerritError as e:
# On success, gerrit returns status 204; anything else is an error.
if e.http_status != 204:
raise
else:
raise GerritError(
'Unexpectedly received a 200 http status while publishing message '
'change in %s' % change)
def GetReviewers(host, change): def GetReviewers(host, change):
"""Get information about all reviewers attached to a change.""" """Get information about all reviewers attached to a change."""
path = 'changes/%s/reviewers' % change path = 'changes/%s/reviewers' % change
......
...@@ -2169,8 +2169,8 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): ...@@ -2169,8 +2169,8 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
return gerrit_util.GetChangeDescriptionFromGitiles(url, current_rev) return gerrit_util.GetChangeDescriptionFromGitiles(url, current_rev)
def UpdateDescriptionRemote(self, description): def UpdateDescriptionRemote(self, description):
gerrit_util.SetCommitMessage(self._GetGerritHost(), self.GetIssue(), # TODO(tandrii)
description) raise NotImplementedError()
def CloseIssue(self): def CloseIssue(self):
gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='') gerrit_util.AbandonChange(self._GetGerritHost(), self.GetIssue(), msg='')
......
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