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

Side by Side Diff: trychange.py

Issue 3853003: Handle gclient_utils.Error exceptions in trychange.py (Closed)
Patch Set: Created 10 years, 2 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
« 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2009 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 """Client-side script to send a try job to the try server. It communicates to 5 """Client-side script to send a try job to the try server. It communicates to
6 the try server by either writting to a svn repository or by directly connecting 6 the try server by either writting to a svn repository or by directly connecting
7 to the server by HTTP. 7 to the server by HTTP.
8 """ 8 """
9 9
10 import datetime 10 import datetime
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 if len(args) == 2 and args[1] == 'help': 602 if len(args) == 2 and args[1] == 'help':
603 parser.print_help() 603 parser.print_help()
604 return 0 604 return 0
605 605
606 # If they've said something confusing, don't spawn a try job until you 606 # If they've said something confusing, don't spawn a try job until you
607 # understand what they want. 607 # understand what they want.
608 if len(args) > 1: 608 if len(args) > 1:
609 plural = "" 609 plural = ""
610 if len(args) > 2: 610 if len(args) > 2:
611 plural = "s" 611 plural = "s"
612 print "Argument%s \"%s\" not understood" % (plural, " ".join(args[1:])) 612 print "Argument%s \"%s\" not understood" % (plural, " ".join(args[1:]))
jochen (gone - plz use gerrit) 2010/10/19 13:11:01 shouldn't this go to stderr as well?
613 parser.print_help() 613 parser.print_help()
614 return 1 614 return 1
615 615
616 LOG_FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s' 616 LOG_FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s'
617 if not swallow_exception: 617 if not swallow_exception:
618 if options.verbose == 0: 618 if options.verbose == 0:
619 logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT) 619 logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT)
620 elif options.verbose == 1: 620 elif options.verbose == 1:
621 logging.basicConfig(level=logging.INFO, format=LOG_FORMAT) 621 logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
622 elif options.verbose > 1: 622 elif options.verbose > 1:
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 return 0 739 return 0
740 except NoTryServerAccess: 740 except NoTryServerAccess:
741 if not can_svn: 741 if not can_svn:
742 raise 742 raise
743 _SendChangeSVN(options) 743 _SendChangeSVN(options)
744 PrintSuccess(options) 744 PrintSuccess(options)
745 return 0 745 return 0
746 except (InvalidScript, NoTryServerAccess), e: 746 except (InvalidScript, NoTryServerAccess), e:
747 if swallow_exception: 747 if swallow_exception:
748 return 1 748 return 1
749 print e 749 print >> sys.stderr, e
750 return 1
751 except gclient_utils.Error, e:
752 print >> sys.stderr, e
750 return 1 753 return 1
751 return 0 754 return 0
752 755
753 756
754 if __name__ == "__main__": 757 if __name__ == "__main__":
755 sys.exit(TryChange(None, [], False)) 758 sys.exit(TryChange(None, [], False))
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