OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-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 # | 5 # |
6 # Wrapper script around Rietveld's upload.py that groups files into | 6 # Wrapper script around Rietveld's upload.py that groups files into |
7 # changelists. | 7 # changelists. |
8 | 8 |
9 import getpass | 9 import getpass |
10 import os | 10 import os |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 if "--send-mail" in args: | 708 if "--send-mail" in args: |
709 args.remove("--send-mail") | 709 args.remove("--send-mail") |
710 args.append("--send_mail") | 710 args.append("--send_mail") |
711 | 711 |
712 # Supports --clobber for the try server. | 712 # Supports --clobber for the try server. |
713 clobber = False | 713 clobber = False |
714 if "--clobber" in args: | 714 if "--clobber" in args: |
715 args.remove("--clobber") | 715 args.remove("--clobber") |
716 clobber = True | 716 clobber = True |
717 | 717 |
718 # TODO(pamg): Do something when tests are missing. The plan is to upload a | 718 # Disable try when the server is overridden. |
719 # message to Rietveld and have it shown in the UI attached to this patch. | 719 server_1 = re.compile(r"^-s\b.*") |
| 720 server_2 = re.compile(r"^--server\b.*") |
| 721 for arg in args: |
| 722 if server_1.match(arg) or server_2.match(arg): |
| 723 no_try = True |
| 724 break |
720 | 725 |
721 upload_arg = ["upload.py", "-y"] | 726 upload_arg = ["upload.py", "-y"] |
722 upload_arg.append("--server=" + GetCodeReviewSetting("CODE_REVIEW_SERVER")) | 727 upload_arg.append("--server=" + GetCodeReviewSetting("CODE_REVIEW_SERVER")) |
723 upload_arg.extend(args) | 728 upload_arg.extend(args) |
724 | 729 |
725 desc_file = "" | 730 desc_file = "" |
726 if change_info.issue: # Uploading a new patchset. | 731 if change_info.issue: # Uploading a new patchset. |
727 found_message = False | 732 found_message = False |
728 for arg in args: | 733 for arg in args: |
729 if arg.startswith("--message") or arg.startswith("-m"): | 734 if arg.startswith("--message") or arg.startswith("-m"): |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 # the files. This allows commands such as 'gcl diff xxx' to work. | 1097 # the files. This allows commands such as 'gcl diff xxx' to work. |
1093 args =["svn", command] | 1098 args =["svn", command] |
1094 root = GetRepositoryRoot() | 1099 root = GetRepositoryRoot() |
1095 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1100 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
1096 RunShell(args, True) | 1101 RunShell(args, True) |
1097 return 0 | 1102 return 0 |
1098 | 1103 |
1099 | 1104 |
1100 if __name__ == "__main__": | 1105 if __name__ == "__main__": |
1101 sys.exit(main()) | 1106 sys.exit(main()) |
OLD | NEW |