OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines()) | 770 diff = GetMungedDiff('', urllib.urlopen(diff_url).readlines()) |
771 options.diff = ''.join(diff[0]) | 771 options.diff = ''.join(diff[0]) |
772 changed_files = diff[1] | 772 changed_files = diff[1] |
773 else: | 773 else: |
774 # Use this as the base. | 774 # Use this as the base. |
775 root = checkouts[0].checkout_root | 775 root = checkouts[0].checkout_root |
776 diffs = [] | 776 diffs = [] |
777 for checkout in checkouts: | 777 for checkout in checkouts: |
778 raw_diff = checkout.GenerateDiff() | 778 raw_diff = checkout.GenerateDiff() |
779 if not raw_diff: | 779 if not raw_diff: |
| 780 logging.error('Empty or non-existant diff, exiting.') |
780 return 1 | 781 return 1 |
781 diff = raw_diff.splitlines(True) | 782 diff = raw_diff.splitlines(True) |
782 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) | 783 path_diff = gclient_utils.PathDifference(root, checkout.checkout_root) |
783 # Munge it. | 784 # Munge it. |
784 diffs.extend(GetMungedDiff(path_diff, diff)[0]) | 785 diffs.extend(GetMungedDiff(path_diff, diff)[0]) |
785 options.diff = ''.join(diffs) | 786 options.diff = ''.join(diffs) |
786 | 787 |
787 if not options.name: | 788 if not options.name: |
788 if options.issue: | 789 if options.issue: |
789 options.name = 'Issue %s' % options.issue | 790 options.name = 'Issue %s' % options.issue |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 return 1 | 874 return 1 |
874 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 875 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
875 print >> sys.stderr, e | 876 print >> sys.stderr, e |
876 return 1 | 877 return 1 |
877 return 0 | 878 return 0 |
878 | 879 |
879 | 880 |
880 if __name__ == "__main__": | 881 if __name__ == "__main__": |
881 fix_encoding.fix_encoding() | 882 fix_encoding.fix_encoding() |
882 sys.exit(TryChange(None, None, False)) | 883 sys.exit(TryChange(None, None, False)) |
OLD | NEW |