Commit 10ccd112 authored by maruel@chromium.org's avatar maruel@chromium.org

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
parent 559c3f89
......@@ -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
......
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