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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 # Let's say if dir1 is deleted, --non-recursive must *not* be used otherwise | 885 # Let's say if dir1 is deleted, --non-recursive must *not* be used otherwise |
886 # you'll get "svn: Cannot non-recursively commit a directory deletion of a | 886 # you'll get "svn: Cannot non-recursively commit a directory deletion of a |
887 # directory with child nodes". Yay... | 887 # directory with child nodes". Yay... |
888 commit_cmd = ["svn", "commit"] | 888 commit_cmd = ["svn", "commit"] |
889 if change_info.issue: | 889 if change_info.issue: |
890 # Get the latest description from Rietveld. | 890 # Get the latest description from Rietveld. |
891 change_info.description = GetIssueDescription(change_info.issue) | 891 change_info.description = GetIssueDescription(change_info.issue) |
892 | 892 |
893 commit_message = change_info.description.replace('\r\n', '\n') | 893 commit_message = change_info.description.replace('\r\n', '\n') |
894 if change_info.issue: | 894 if change_info.issue: |
895 commit_message += ('\nReview URL: http://%s/%d' % | 895 server = GetCodeReviewSetting("CODE_REVIEW_SERVER") |
896 (GetCodeReviewSetting("CODE_REVIEW_SERVER"), | 896 if not server.startswith("http://") and not server.startswith("https://"): |
897 change_info.issue)) | 897 server = "http://" + server |
| 898 commit_message += ('\nReview URL: %s/%d' % (server, change_info.issue)) |
898 | 899 |
899 handle, commit_filename = tempfile.mkstemp(text=True) | 900 handle, commit_filename = tempfile.mkstemp(text=True) |
900 os.write(handle, commit_message) | 901 os.write(handle, commit_message) |
901 os.close(handle) | 902 os.close(handle) |
902 | 903 |
903 handle, targets_filename = tempfile.mkstemp(text=True) | 904 handle, targets_filename = tempfile.mkstemp(text=True) |
904 os.write(handle, "\n".join(change_info.GetFileNames())) | 905 os.write(handle, "\n".join(change_info.GetFileNames())) |
905 os.close(handle) | 906 os.close(handle) |
906 | 907 |
907 commit_cmd += ['--file=' + commit_filename] | 908 commit_cmd += ['--file=' + commit_filename] |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 return 0 | 1229 return 0 |
1229 args =["svn", command] | 1230 args =["svn", command] |
1230 root = GetRepositoryRoot() | 1231 root = GetRepositoryRoot() |
1231 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1232 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1232 RunShell(args, True) | 1233 RunShell(args, True) |
1233 return 0 | 1234 return 0 |
1234 | 1235 |
1235 | 1236 |
1236 if __name__ == "__main__": | 1237 if __name__ == "__main__": |
1237 sys.exit(main()) | 1238 sys.exit(main()) |
OLD | NEW |