| 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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 file_re = re.compile(r"^[a-z].+\Z", re.IGNORECASE) | 983 file_re = re.compile(r"^[a-z].+\Z", re.IGNORECASE) |
| 984 affected_files = filter(lambda x: file_re.match(x[0]), other_files) | 984 affected_files = filter(lambda x: file_re.match(x[0]), other_files) |
| 985 unaffected_files = filter(lambda x: not file_re.match(x[0]), other_files) | 985 unaffected_files = filter(lambda x: not file_re.match(x[0]), other_files) |
| 986 | 986 |
| 987 separator1 = ("\n---All lines above this line become the description.\n" | 987 separator1 = ("\n---All lines above this line become the description.\n" |
| 988 "---Repository Root: " + change_info.GetLocalRoot() + "\n" | 988 "---Repository Root: " + change_info.GetLocalRoot() + "\n" |
| 989 "---Paths in this changelist (" + change_info.name + "):\n") | 989 "---Paths in this changelist (" + change_info.name + "):\n") |
| 990 separator2 = "\n\n---Paths modified but not in any changelist:\n\n" | 990 separator2 = "\n\n---Paths modified but not in any changelist:\n\n" |
| 991 text = (description + separator1 + '\n' + | 991 text = (description + separator1 + '\n' + |
| 992 '\n'.join([f[0] + f[1] for f in change_info.GetFiles()]) + | 992 '\n'.join([f[0] + f[1] for f in change_info.GetFiles()]) + |
| 993 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n' + |
| 993 separator2 + | 994 separator2 + |
| 994 '\n'.join([f[0] + f[1] for f in affected_files]) + '\n' + | 995 '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n' |
| 995 '\n'.join([f[0] + f[1] for f in unaffected_files]) + '\n') | 996 ) |
| 996 | 997 |
| 997 handle, filename = tempfile.mkstemp(text=True) | 998 handle, filename = tempfile.mkstemp(text=True) |
| 998 os.write(handle, text) | 999 os.write(handle, text) |
| 999 os.close(handle) | 1000 os.close(handle) |
| 1000 | 1001 |
| 1001 os.system(GetEditor() + " " + filename) | 1002 os.system(GetEditor() + " " + filename) |
| 1002 | 1003 |
| 1003 result = ReadFile(filename) | 1004 result = ReadFile(filename) |
| 1004 os.remove(filename) | 1005 os.remove(filename) |
| 1005 | 1006 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 # the files. This allows commands such as 'gcl diff xxx' to work. | 1228 # the files. This allows commands such as 'gcl diff xxx' to work. |
| 1228 args =["svn", command] | 1229 args =["svn", command] |
| 1229 root = GetRepositoryRoot() | 1230 root = GetRepositoryRoot() |
| 1230 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1231 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
| 1231 RunShell(args, True) | 1232 RunShell(args, True) |
| 1232 return 0 | 1233 return 0 |
| 1233 | 1234 |
| 1234 | 1235 |
| 1235 if __name__ == "__main__": | 1236 if __name__ == "__main__": |
| 1236 sys.exit(main()) | 1237 sys.exit(main()) |
| OLD | NEW |