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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 self.checkout_root = scm.SVN.GetCheckoutRoot(self.checkout_root) | 145 self.checkout_root = scm.SVN.GetCheckoutRoot(self.checkout_root) |
146 if not self.options.email: | 146 if not self.options.email: |
147 # Assumes the svn credential is an email address. | 147 # Assumes the svn credential is an email address. |
148 self.options.email = scm.SVN.GetEmail(self.checkout_root) | 148 self.options.email = scm.SVN.GetEmail(self.checkout_root) |
149 logging.info("SVN(%s)" % self.checkout_root) | 149 logging.info("SVN(%s)" % self.checkout_root) |
150 | 150 |
151 def ReadRootFile(self, filename): | 151 def ReadRootFile(self, filename): |
152 try: | 152 try: |
153 # Try to search on the subversion repository for the file. | 153 # Try to search on the subversion repository for the file. |
154 import gcl | 154 import gcl |
155 data = gcl.GetCachedFile(filename, use_root=True) | 155 data = gcl.GetCachedFile(filename) |
156 logging.debug('%s:\n%s' % (filename, data)) | 156 logging.debug('%s:\n%s' % (filename, data)) |
157 return data | 157 return data |
158 except ImportError: | 158 except ImportError: |
159 try: | 159 try: |
160 data = gclient_utils.FileRead(os.path.join(self.checkout_root, | 160 data = gclient_utils.FileRead(os.path.join(self.checkout_root, |
161 filename)) | 161 filename)) |
162 logging.debug('%s:\n%s' % (filename, data)) | 162 logging.debug('%s:\n%s' % (filename, data)) |
163 return data | 163 return data |
164 except (IOError, OSError): | 164 except (IOError, OSError): |
165 logging.debug('%s:\nNone' % filename) | 165 logging.debug('%s:\nNone' % filename) |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 except (InvalidScript, NoTryServerAccess), e: | 611 except (InvalidScript, NoTryServerAccess), e: |
612 if swallow_exception: | 612 if swallow_exception: |
613 return 1 | 613 return 1 |
614 print e | 614 print e |
615 return 1 | 615 return 1 |
616 return 0 | 616 return 0 |
617 | 617 |
618 | 618 |
619 if __name__ == "__main__": | 619 if __name__ == "__main__": |
620 sys.exit(TryChange(None, [], False)) | 620 sys.exit(TryChange(None, [], False)) |
OLD | NEW |