Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: gcl.py

Issue 8413015: Add some error checking to CMDpassthru for invalid arguments. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """\ 6 """\
7 Wrapper script around Rietveld's upload.py that simplifies working with groups 7 Wrapper script around Rietveld's upload.py that simplifies working with groups
8 of files. 8 of files.
9 """ 9 """
10 10
(...skipping 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1332 os.rename(src_file, dst_file) 1332 os.rename(src_file, dst_file)
1333 print "Change '%s' renamed '%s'." % (src, dst) 1333 print "Change '%s' renamed '%s'." % (src, dst)
1334 return 0 1334 return 0
1335 1335
1336 1336
1337 def CMDpassthru(args): 1337 def CMDpassthru(args):
1338 """Everything else that is passed into gcl we redirect to svn. 1338 """Everything else that is passed into gcl we redirect to svn.
1339 1339
1340 It assumes a change list name is passed and is converted with the files names. 1340 It assumes a change list name is passed and is converted with the files names.
1341 """ 1341 """
1342 if not args or len(args) < 2:
1343 ErrorExit("You need to pass a change list name for this svn fall-through "
1344 "command")
1342 cl_name = args[1] 1345 cl_name = args[1]
1343 args = ["svn", args[0]] 1346 args = ["svn", args[0]]
1344 if len(args) > 1: 1347 if len(args) > 1:
1345 root = GetRepositoryRoot() 1348 root = GetRepositoryRoot()
1346 change_info = ChangeInfo.Load(cl_name, root, True, True) 1349 change_info = ChangeInfo.Load(cl_name, root, True, True)
1347 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) 1350 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()])
1348 return RunShellWithReturnCode(args, print_output=True)[1] 1351 return RunShellWithReturnCode(args, print_output=True)[1]
1349 1352
1350 1353
1351 def Command(name): 1354 def Command(name):
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 raise 1438 raise
1436 print >> sys.stderr, ( 1439 print >> sys.stderr, (
1437 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1440 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1438 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1441 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1439 return 1 1442 return 1
1440 1443
1441 1444
1442 if __name__ == "__main__": 1445 if __name__ == "__main__":
1443 fix_encoding.fix_encoding() 1446 fix_encoding.fix_encoding()
1444 sys.exit(main(sys.argv[1:])) 1447 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698