Commit 642641d0 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

git cl comments: remove Rietveld support.

R=ehmaldonado

Bug: 770408
Change-Id: Ib3120b5fd09c35be691c025d0d69ceda60f2ec7f
Reviewed-on: https://chromium-review.googlesource.com/c/1279135
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
parent feec80e9
...@@ -1944,40 +1944,13 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase): ...@@ -1944,40 +1944,13 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
pass pass
def FetchDescription(self, force=False): def FetchDescription(self, force=False):
issue = self.GetIssue() raise NotImplementedError()
assert issue
try:
return self.RpcServer().get_description(issue, force=force).strip()
except urllib2.HTTPError as e:
if e.code == 404:
DieWithError(
('\nWhile fetching the description for issue %d, received a '
'404 (not found)\n'
'error. It is likely that you deleted this '
'issue on the server. If this is the\n'
'case, please run\n\n'
' git cl issue 0\n\n'
'to clear the association with the deleted issue. Then run '
'this command again.') % issue)
else:
DieWithError(
'\nFailed to fetch issue description. HTTP error %d' % e.code)
except urllib2.URLError as e:
print('Warning: Failed to retrieve CL description due to network '
'failure.', file=sys.stderr)
return ''
def GetMostRecentPatchset(self): def GetMostRecentPatchset(self):
return self.GetIssueProperties()['patchsets'][-1] raise NotImplementedError()
def GetIssueProperties(self): def GetIssueProperties(self):
if self._props is None: raise NotImplementedError()
issue = self.GetIssue()
if not issue:
self._props = {}
else:
self._props = self.RpcServer().get_issue_properties(issue, True)
return self._props
def CannotTriggerTryJobReason(self): def CannotTriggerTryJobReason(self):
raise NotImplementedError() raise NotImplementedError()
...@@ -4606,12 +4579,11 @@ def CMDcomments(parser, args): ...@@ -4606,12 +4579,11 @@ def CMDcomments(parser, args):
issue = int(options.issue) issue = int(options.issue)
except ValueError: except ValueError:
DieWithError('A review issue id is expected to be a number') DieWithError('A review issue id is expected to be a number')
if not options.forced_codereview:
parser.error('--gerrit or --rietveld is required if --issue is specified')
cl = Changelist(issue=issue, cl = Changelist(issue=issue, codereview='gerrit', auth_config=auth_config)
codereview=options.forced_codereview,
auth_config=auth_config) if not cl.IsGerrit():
parser.error('rietveld is not supported')
if options.comment: if options.comment:
cl.AddComment(options.comment) cl.AddComment(options.comment)
......
...@@ -2904,7 +2904,7 @@ class TestGitCl(TestCase): ...@@ -2904,7 +2904,7 @@ class TestGitCl(TestCase):
] ]
cl = git_cl.Changelist(codereview='gerrit', issue=1) cl = git_cl.Changelist(codereview='gerrit', issue=1)
self.assertEqual(cl.GetCommentsSummary(), expected_comments_summary) self.assertEqual(cl.GetCommentsSummary(), expected_comments_summary)
self.assertEqual(0, git_cl.main(['comment', '--gerrit', '-i', '1', self.assertEqual(0, git_cl.main(['comment', '-i', '1',
'-j', 'output.json'])) '-j', 'output.json']))
def test_get_remote_url_with_mirror(self): def test_get_remote_url_with_mirror(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