| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2009 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 |
| 11 import datetime | 11 import datetime |
| 12 import errno | 12 import errno |
| 13 import getpass | 13 import getpass |
| 14 import logging | 14 import logging |
| 15 import optparse | 15 import optparse |
| 16 import os | 16 import os |
| 17 import posixpath | 17 import posixpath |
| 18 import re | 18 import re |
| 19 import shutil | 19 import shutil |
| 20 import sys | 20 import sys |
| 21 import tempfile | 21 import tempfile |
| 22 import urllib | 22 import urllib |
| 23 | 23 |
| 24 try: | 24 try: |
| 25 import simplejson as json # pylint: disable=F0401 | 25 import simplejson as json # pylint: disable=F0401 |
| 26 except ImportError: | 26 except ImportError: |
| 27 try: | 27 try: |
| 28 import json | 28 import json # pylint: disable=F0401 |
| 29 except ImportError: | 29 except ImportError: |
| 30 json = None | 30 # Import the one included in depot_tools. |
| 31 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) |
| 32 import simplejson as json # pylint: disable=F0401 |
| 31 | 33 |
| 32 try: | 34 import breakpad # pylint: disable=W0611 |
| 33 import breakpad # pylint: disable=W0611 | |
| 34 except ImportError: | |
| 35 pass | |
| 36 | 35 |
| 37 try: | 36 import gcl |
| 38 import gcl | |
| 39 except ImportError: | |
| 40 gcl = None | |
| 41 | |
| 42 import fix_encoding | 37 import fix_encoding |
| 43 import gclient_utils | 38 import gclient_utils |
| 44 import scm | 39 import scm |
| 45 | 40 |
| 46 __version__ = '1.2' | 41 __version__ = '1.2' |
| 47 | 42 |
| 48 | 43 |
| 49 # Constants | 44 # Constants |
| 50 HELP_STRING = "Sorry, Tryserver is not available." | 45 HELP_STRING = "Sorry, Tryserver is not available." |
| 51 USAGE = r"""%prog [options] | 46 USAGE = r"""%prog [options] |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 return 1 | 760 return 1 |
| 766 except gclient_utils.Error, e: | 761 except gclient_utils.Error, e: |
| 767 print >> sys.stderr, e | 762 print >> sys.stderr, e |
| 768 return 1 | 763 return 1 |
| 769 return 0 | 764 return 0 |
| 770 | 765 |
| 771 | 766 |
| 772 if __name__ == "__main__": | 767 if __name__ == "__main__": |
| 773 fix_encoding.fix_encoding() | 768 fix_encoding.fix_encoding() |
| 774 sys.exit(TryChange(None, [], False)) | 769 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |