Commit c4c40d1b authored by Aaron Gable's avatar Aaron Gable Committed by Commit Bot

git-cl: Print Rietveld deprecation warning

To encourage folks to upload to Gerrit.

Bug: 685321
Change-Id: I849ed53f95a2205959237fe825ffe41e349ff8c7
Reviewed-on: https://chromium-review.googlesource.com/510963Reviewed-by: 's avatarAndrew Bonventre <andybons@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
parent 2e559c98
......@@ -1592,6 +1592,16 @@ class Changelist(object):
base_branch = self.GetCommonAncestorWithUpstream()
git_diff_args = [base_branch, 'HEAD']
# Warn about Rietveld deprecation for initial uploads to Rietveld.
if not self.IsGerrit() and not self.GetIssue():
print('=====================================')
print('NOTICE: Rietveld is being deprecated. '
'You can upload changes to Gerrit with')
print(' git cl upload --gerrit')
print('or set Gerrit to be your default code review tool with')
print(' git config gerrit.host true')
print('=====================================')
# Fast best-effort checks to abort before running potentially
# expensive hooks if uploading is likely to fail anyway. Passing these
# checks does not guarantee that uploading will not fail.
......
......@@ -982,7 +982,15 @@ class TestGitCl(TestCase):
self.mock(sys, 'stdout', stdout)
with self.assertRaises(SystemExitMock):
git_cl.main(['upload', '--send-mail'])
self.assertEqual('', stdout.getvalue())
self.assertEqual(
'=====================================\n'
'NOTICE: Rietveld is being deprecated. '
'You can upload changes to Gerrit with\n'
' git cl upload --gerrit\n'
'or set Gerrit to be your default code review tool with\n'
' git config gerrit.host true\n'
'=====================================\n',
stdout.getvalue())
def test_bug_on_cmd(self):
self._run_reviewer_test(
......
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