diff --git a/git_cl.py b/git_cl.py index 8bb7cd091..4171243c6 100755 --- a/git_cl.py +++ b/git_cl.py @@ -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. diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index e9ceb3d76..570c3abad 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -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(