| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 else: | 357 else: |
| 358 # Add the file to the repo. | 358 # Add the file to the repo. |
| 359 gclient_utils.FileWrite(full_path, options.diff, 'wb') | 359 gclient_utils.FileWrite(full_path, options.diff, 'wb') |
| 360 gclient_utils.CheckCall(["svn", "add", full_path], print_error=False) | 360 gclient_utils.CheckCall(["svn", "add", full_path], print_error=False) |
| 361 temp_file.write(description) | 361 temp_file.write(description) |
| 362 temp_file.flush() | 362 temp_file.flush() |
| 363 gclient_utils.CheckCall(["svn", "commit", full_path, '--file', | 363 gclient_utils.CheckCall(["svn", "commit", full_path, '--file', |
| 364 temp_file.name], print_error=False) | 364 temp_file.name], print_error=False) |
| 365 except gclient_utils.CheckCallError, e: | 365 except gclient_utils.CheckCallError, e: |
| 366 raise NoTryServerAccess(' '.join(e.command) + '\nOuput:\n' + | 366 raise NoTryServerAccess(' '.join(e.command) + '\nOuput:\n' + |
| 367 e.stdout) | 367 e.stdout + e.stderr) |
| 368 finally: | 368 finally: |
| 369 temp_file.close() | 369 temp_file.close() |
| 370 shutil.rmtree(temp_dir, True) | 370 shutil.rmtree(temp_dir, True) |
| 371 | 371 |
| 372 | 372 |
| 373 def PrintSuccess(options): | 373 def PrintSuccess(options): |
| 374 if not options.dry_run: | 374 if not options.dry_run: |
| 375 text = 'Patch \'%s\' sent to try server' % options.name | 375 text = 'Patch \'%s\' sent to try server' % options.name |
| 376 if options.bot: | 376 if options.bot: |
| 377 text += ': %s' % ', '.join(options.bot) | 377 text += ': %s' % ', '.join(options.bot) |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 except (InvalidScript, NoTryServerAccess), e: | 666 except (InvalidScript, NoTryServerAccess), e: |
| 667 if swallow_exception: | 667 if swallow_exception: |
| 668 return 1 | 668 return 1 |
| 669 print e | 669 print e |
| 670 return 1 | 670 return 1 |
| 671 return 0 | 671 return 0 |
| 672 | 672 |
| 673 | 673 |
| 674 if __name__ == "__main__": | 674 if __name__ == "__main__": |
| 675 sys.exit(TryChange(None, [], False)) | 675 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |