| OLD | NEW |
| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 """Determines settings based on supported code review and checkout tools. | 149 """Determines settings based on supported code review and checkout tools. |
| 150 """ | 150 """ |
| 151 self._GclientStyleSettings() | 151 self._GclientStyleSettings() |
| 152 self._GclStyleSettings() | 152 self._GclStyleSettings() |
| 153 | 153 |
| 154 def ReadRootFile(self, filename): | 154 def ReadRootFile(self, filename): |
| 155 if not self.options.root: | 155 if not self.options.root: |
| 156 filepath = os.path.join(self.checkout_root, filename) | 156 filepath = os.path.join(self.checkout_root, filename) |
| 157 if os.path.isfile(filepath): | 157 if os.path.isfile(filepath): |
| 158 logging.info('Found %s at %s' % (filename, self.checkout_root)) | 158 logging.info('Found %s at %s' % (filename, self.checkout_root)) |
| 159 return gclient_util.FileRead(filepath) | 159 return gclient_utils.FileRead(filepath) |
| 160 return None | 160 return None |
| 161 cur = os.path.abspath(self.checkout_root) | 161 cur = os.path.abspath(self.checkout_root) |
| 162 if self.gclient_root: | 162 if self.gclient_root: |
| 163 root = os.path.abspath(self.gclient_root) | 163 root = os.path.abspath(self.gclient_root) |
| 164 else: | 164 else: |
| 165 root = gclient_utils.FindGclientRoot(cur) | 165 root = gclient_utils.FindGclientRoot(cur) |
| 166 assert cur.startswith(root), (root, cur) | 166 assert cur.startswith(root), (root, cur) |
| 167 while cur.startswith(root): | 167 while cur.startswith(root): |
| 168 filepath = os.path.join(cur, filename) | 168 filepath = os.path.join(cur, filename) |
| 169 if os.path.isfile(filepath): | 169 if os.path.isfile(filepath): |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 except (InvalidScript, NoTryServerAccess), e: | 721 except (InvalidScript, NoTryServerAccess), e: |
| 722 if swallow_exception: | 722 if swallow_exception: |
| 723 return 1 | 723 return 1 |
| 724 print e | 724 print e |
| 725 return 1 | 725 return 1 |
| 726 return 0 | 726 return 0 |
| 727 | 727 |
| 728 | 728 |
| 729 if __name__ == "__main__": | 729 if __name__ == "__main__": |
| 730 sys.exit(TryChange(None, [], False)) | 730 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |