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

Side by Side Diff: gcl.py

Issue 6735029: gcl delete <non-existent change> won't throw an exception anymore (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: better error message Created 9 years, 8 months 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 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 def CMDdescription(change_info): 1297 def CMDdescription(change_info):
1298 """Prints the description of the specified change to stdout.""" 1298 """Prints the description of the specified change to stdout."""
1299 print change_info.description 1299 print change_info.description
1300 return 0 1300 return 0
1301 1301
1302 1302
1303 def CMDdelete(args): 1303 def CMDdelete(args):
1304 """Deletes a changelist.""" 1304 """Deletes a changelist."""
1305 if not len(args) == 1: 1305 if not len(args) == 1:
1306 ErrorExit('You need to pass a change list name') 1306 ErrorExit('You need to pass a change list name')
1307 os.remove(GetChangelistInfoFile(args[0])) 1307 filepath = GetChangelistInfoFile(args[0])
1308 if not os.path.isfile(filepath):
1309 ErrorExit('You need to pass a valid change list name')
1310 os.remove(filepath)
1308 return 0 1311 return 0
1309 1312
1310 1313
1311 def CMDtry(args): 1314 def CMDtry(args):
1312 """Sends the change to the tryserver to do a test run on your code. 1315 """Sends the change to the tryserver to do a test run on your code.
1313 1316
1314 To send multiple changes as one path, use a comma-separated list of 1317 To send multiple changes as one path, use a comma-separated list of
1315 changenames. Use 'gcl help try' for more information!""" 1318 changenames. Use 'gcl help try' for more information!"""
1316 # When the change contains no file, send the "changename" positional 1319 # When the change contains no file, send the "changename" positional
1317 # argument to trychange.py. 1320 # argument to trychange.py.
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 raise 1452 raise
1450 print >> sys.stderr, ( 1453 print >> sys.stderr, (
1451 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' 1454 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith '
1452 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) 1455 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))
1453 return 1 1456 return 1
1454 1457
1455 1458
1456 if __name__ == "__main__": 1459 if __name__ == "__main__":
1457 fix_encoding.fix_encoding() 1460 fix_encoding.fix_encoding()
1458 sys.exit(main(sys.argv[1:])) 1461 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