| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 # Windows' svn.exe has no clue about cygwin paths. Hence force to use | 394 # Windows' svn.exe has no clue about cygwin paths. Hence force to use |
| 395 # the cygwin version in this particular context. | 395 # the cygwin version in this particular context. |
| 396 exe = "/usr/bin/svn" | 396 exe = "/usr/bin/svn" |
| 397 else: | 397 else: |
| 398 exe = "svn" | 398 exe = "svn" |
| 399 command = [exe, 'import', '-q', temp_dir, options.svn_repo, '--file', | 399 command = [exe, 'import', '-q', temp_dir, options.svn_repo, '--file', |
| 400 temp_file.name] | 400 temp_file.name] |
| 401 if scm.SVN.AssertVersion("1.5")[0]: | 401 if scm.SVN.AssertVersion("1.5")[0]: |
| 402 command.append('--no-ignore') | 402 command.append('--no-ignore') |
| 403 | 403 |
| 404 subprocess2.check_output( | 404 subprocess2.check_call(command) |
| 405 command, stdout=subprocess2.PIPE, stderr=subprocess2.STDOUT) | |
| 406 except subprocess2.CalledProcessError, e: | 405 except subprocess2.CalledProcessError, e: |
| 407 raise NoTryServerAccess(' '.join(e.cmd) + '\nOuput:\n' + e.stdout) | 406 raise NoTryServerAccess(str(e)) |
| 408 finally: | 407 finally: |
| 409 temp_file.close() | 408 temp_file.close() |
| 410 shutil.rmtree(temp_dir, True) | 409 shutil.rmtree(temp_dir, True) |
| 411 | 410 |
| 412 | 411 |
| 413 def PrintSuccess(options): | 412 def PrintSuccess(options): |
| 414 if not options.dry_run: | 413 if not options.dry_run: |
| 415 text = 'Patch \'%s\' sent to try server' % options.name | 414 text = 'Patch \'%s\' sent to try server' % options.name |
| 416 if options.bot: | 415 if options.bot: |
| 417 text += ': %s' % ', '.join(options.bot) | 416 text += ': %s' % ', '.join(options.bot) |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 return 1 | 761 return 1 |
| 763 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 762 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 764 print >> sys.stderr, e | 763 print >> sys.stderr, e |
| 765 return 1 | 764 return 1 |
| 766 return 0 | 765 return 0 |
| 767 | 766 |
| 768 | 767 |
| 769 if __name__ == "__main__": | 768 if __name__ == "__main__": |
| 770 fix_encoding.fix_encoding() | 769 fix_encoding.fix_encoding() |
| 771 sys.exit(TryChange(None, [], False)) | 770 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |