| OLD | NEW |
| 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 """Client-side script to send a try job to the try server. It communicates to | 6 """Client-side script to send a try job to the try server. It communicates to |
| 7 the try server by either writting to a svn repository or by directly connecting | 7 the try server by either writting to a svn repository or by directly connecting |
| 8 to the server by HTTP. | 8 to the server by HTTP. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 # Import the one included in depot_tools. | 30 # Import the one included in depot_tools. |
| 31 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) | 31 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) |
| 32 import simplejson as json # pylint: disable=F0401 | 32 import simplejson as json # pylint: disable=F0401 |
| 33 | 33 |
| 34 import breakpad # pylint: disable=W0611 | 34 import breakpad # pylint: disable=W0611 |
| 35 | 35 |
| 36 import gcl | 36 import gcl |
| 37 import fix_encoding | 37 import fix_encoding |
| 38 import gclient_utils | 38 import gclient_utils |
| 39 import scm | 39 import scm |
| 40 import subprocess2 |
| 41 |
| 40 | 42 |
| 41 __version__ = '1.2' | 43 __version__ = '1.2' |
| 42 | 44 |
| 43 | 45 |
| 44 # Constants | 46 # Constants |
| 45 HELP_STRING = "Sorry, Tryserver is not available." | 47 HELP_STRING = "Sorry, Tryserver is not available." |
| 46 USAGE = r"""%prog [options] | 48 USAGE = r"""%prog [options] |
| 47 | 49 |
| 48 Client-side script to send a try job to the try server. It communicates to | 50 Client-side script to send a try job to the try server. It communicates to |
| 49 the try server by either writting to a svn repository or by directly connecting | 51 the try server by either writting to a svn repository or by directly connecting |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 if not can_svn: | 753 if not can_svn: |
| 752 raise | 754 raise |
| 753 _SendChangeSVN(options) | 755 _SendChangeSVN(options) |
| 754 PrintSuccess(options) | 756 PrintSuccess(options) |
| 755 return 0 | 757 return 0 |
| 756 except (InvalidScript, NoTryServerAccess), e: | 758 except (InvalidScript, NoTryServerAccess), e: |
| 757 if swallow_exception: | 759 if swallow_exception: |
| 758 return 1 | 760 return 1 |
| 759 print >> sys.stderr, e | 761 print >> sys.stderr, e |
| 760 return 1 | 762 return 1 |
| 761 except gclient_utils.Error, e: | 763 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 762 print >> sys.stderr, e | 764 print >> sys.stderr, e |
| 763 return 1 | 765 return 1 |
| 764 return 0 | 766 return 0 |
| 765 | 767 |
| 766 | 768 |
| 767 if __name__ == "__main__": | 769 if __name__ == "__main__": |
| 768 fix_encoding.fix_encoding() | 770 fix_encoding.fix_encoding() |
| 769 sys.exit(TryChange(None, [], False)) | 771 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |