Disable the use of -s or --server with gcl upload.

It contradicts the previous changes to enforce codereview.settings.

TEST=new unit test
BUG=none

Review URL: http://codereview.chromium.org/3171026

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@57195 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 15 years ago
parent 559c3f89b6
commit 10ccd1124c

@ -722,6 +722,8 @@ def CMDupload(change_info, args):
This does not submit a try job; use gcl try to submit a try job.
"""
if '-s' in args or '--server' in args:
ErrorExit('Don\'t use the -s flag, fix codereview.settings instead')
if not change_info.GetFiles():
print "Nothing to upload, changelist is empty."
return 0

@ -325,6 +325,22 @@ class CMDuploadUnittest(GclTestsBase):
self.assertEquals(change_info.issue, 1)
self.assertEquals(change_info.patchset, 2)
def testNoServer(self):
self.mox.StubOutWithMock(gcl.sys, 'stderr')
gcl.sys.stderr.write(
'Don\'t use the -s flag, fix codereview.settings instead')
gcl.sys.stderr.write('\n')
gcl.GetRepositoryRoot().AndReturn(self.fake_root_dir)
gcl.ChangeInfo.Load('naame', self.fake_root_dir, True, True
).AndReturn(1)
self.mox.ReplayAll()
try:
gcl.CMDupload(['naame', '-s', 'foo'])
self.fail()
except SystemExit:
pass
if __name__ == '__main__':
import unittest

Loading…
Cancel
Save