| 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 else: | 561 else: |
| 562 # Use this as the base. | 562 # Use this as the base. |
| 563 root = checkouts[0].checkout_root | 563 root = checkouts[0].checkout_root |
| 564 diffs = [] | 564 diffs = [] |
| 565 for checkout in checkouts: | 565 for checkout in checkouts: |
| 566 diff = checkout.GenerateDiff().splitlines(True) | 566 diff = checkout.GenerateDiff().splitlines(True) |
| 567 # Munge it. | 567 # Munge it. |
| 568 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) | 568 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) |
| 569 for i in range(len(diff)): | 569 for i in range(len(diff)): |
| 570 if diff[i].startswith('--- ') or diff[i].startswith('+++ '): | 570 if diff[i].startswith('--- ') or diff[i].startswith('+++ '): |
| 571 diff[i] = diff[i][0:4] + posixpath.join(path_diff, diff[i][4:]) | 571 new_file = posixpath.join(path_diff, diff[i][4:]).replace('\\', '/') |
| 572 diff[i] = diff[i][0:4] + new_file |
| 572 diffs.extend(diff) | 573 diffs.extend(diff) |
| 573 options.diff = ''.join(diffs) | 574 options.diff = ''.join(diffs) |
| 574 | 575 |
| 575 if not options.bot: | 576 if not options.bot: |
| 576 # Get try slaves from PRESUBMIT.py files if not specified. | 577 # Get try slaves from PRESUBMIT.py files if not specified. |
| 577 # Even if the diff comes from options.url, use the local checkout for bot | 578 # Even if the diff comes from options.url, use the local checkout for bot |
| 578 # selection. | 579 # selection. |
| 579 try: | 580 try: |
| 580 import presubmit_support | 581 import presubmit_support |
| 581 root_presubmit = checkouts[0].ReadRootFile('PRESUBMIT.py') | 582 root_presubmit = checkouts[0].ReadRootFile('PRESUBMIT.py') |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 except (InvalidScript, NoTryServerAccess), e: | 623 except (InvalidScript, NoTryServerAccess), e: |
| 623 if swallow_exception: | 624 if swallow_exception: |
| 624 return 1 | 625 return 1 |
| 625 print e | 626 print e |
| 626 return 1 | 627 return 1 |
| 627 return 0 | 628 return 0 |
| 628 | 629 |
| 629 | 630 |
| 630 if __name__ == "__main__": | 631 if __name__ == "__main__": |
| 631 sys.exit(TryChange(None, [], False)) | 632 sys.exit(TryChange(None, [], False)) |
| OLD | NEW |