| 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 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 description = change_info.description | 973 description = change_info.description |
| 974 | 974 |
| 975 other_files = GetFilesNotInCL() | 975 other_files = GetFilesNotInCL() |
| 976 | 976 |
| 977 #Edited files will have a letter for the first character in a string. | 977 #Edited files will have a letter for the first character in a string. |
| 978 #This regex looks for the presence of that character. | 978 #This regex looks for the presence of that character. |
| 979 file_re = re.compile(r"^[a-z].+\Z", re.IGNORECASE) | 979 file_re = re.compile(r"^[a-z].+\Z", re.IGNORECASE) |
| 980 affected_files = filter(lambda x: file_re.match(x[0]), other_files) | 980 affected_files = filter(lambda x: file_re.match(x[0]), other_files) |
| 981 unaffected_files = filter(lambda x: not file_re.match(x[0]), other_files) | 981 unaffected_files = filter(lambda x: not file_re.match(x[0]), other_files) |
| 982 | 982 |
| 983 separator1 = ("\n---All lines above this line become the description.\n" | 983 separator1 = ("\n---All lines above this line become the description.\n\n" |
| 984 "BUG= http://crbug.com/<bugid>\n" |
| 985 "TEST= <Provide notes to help QA verify this change.>\n" |
| 986 "RELEASE_NOTES\n" |
| 987 " <Add this token to the end of your description to include\n" |
| 988 " this change in the release notes. Please make the first\n" |
| 989 " line of the description a brief, complete sentence.>\n\n" |
| 984 "---Repository Root: " + change_info.GetLocalRoot() + "\n" | 990 "---Repository Root: " + change_info.GetLocalRoot() + "\n" |
| 985 "---Paths in this changelist (" + change_info.name + "):\n") | 991 "---Paths in this changelist (" + change_info.name + "):\n") |
| 986 separator2 = "\n\n---Paths modified but not in any changelist:\n\n" | 992 separator2 = "\n\n---Paths modified but not in any changelist:\n\n" |
| 987 text = (description + separator1 + '\n' + | 993 text = (description + separator1 + '\n' + |
| 988 '\n'.join([f[0] + f[1] for f in change_info.GetFiles()]) + | 994 '\n'.join([f[0] + f[1] for f in change_info.GetFiles()]) + |
| 989 separator2 + | 995 separator2 + |
| 990 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n' + | 996 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n' + |
| 991 '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n') | 997 '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n') |
| 992 | 998 |
| 993 handle, filename = tempfile.mkstemp(text=True) | 999 handle, filename = tempfile.mkstemp(text=True) |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 # the files. This allows commands such as 'gcl diff xxx' to work. | 1211 # the files. This allows commands such as 'gcl diff xxx' to work. |
| 1206 args =["svn", command] | 1212 args =["svn", command] |
| 1207 root = GetRepositoryRoot() | 1213 root = GetRepositoryRoot() |
| 1208 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1214 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
| 1209 RunShell(args, True) | 1215 RunShell(args, True) |
| 1210 return 0 | 1216 return 0 |
| 1211 | 1217 |
| 1212 | 1218 |
| 1213 if __name__ == "__main__": | 1219 if __name__ == "__main__": |
| 1214 sys.exit(main()) | 1220 sys.exit(main()) |
| OLD | NEW |