| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 # gcl now depends on gclient. | 23 # gcl now depends on gclient. |
| 24 from scm import SVN | 24 from scm import SVN |
| 25 import gclient_utils | 25 import gclient_utils |
| 26 | 26 |
| 27 __version__ = '1.1.3' | 27 __version__ = '1.1.3' |
| 28 | 28 |
| 29 | 29 |
| 30 CODEREVIEW_SETTINGS = { | 30 CODEREVIEW_SETTINGS = { |
| 31 # Default values. | 31 # Default values. |
| 32 "CODE_REVIEW_SERVER": "codereview.chromium.org", | 32 "CODE_REVIEW_SERVER": "codereview.appspot.com", |
| 33 "CC_LIST": "chromium-reviews@googlegroups.com", | |
| 34 "VIEW_VC": "http://src.chromium.org/viewvc/chrome?view=rev&revision=", | |
| 35 } | 33 } |
| 36 | 34 |
| 37 # globals that store the root of the current repository and the directory where | 35 # globals that store the root of the current repository and the directory where |
| 38 # we store information about changelists. | 36 # we store information about changelists. |
| 39 REPOSITORY_ROOT = "" | 37 REPOSITORY_ROOT = "" |
| 40 | 38 |
| 41 # Filename where we store repository specific information for gcl. | 39 # Filename where we store repository specific information for gcl. |
| 42 CODEREVIEW_SETTINGS_FILE = "codereview.settings" | 40 CODEREVIEW_SETTINGS_FILE = "codereview.settings" |
| 43 | 41 |
| 44 # Warning message when the change appears to be missing tests. | 42 # Warning message when the change appears to be missing tests. |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1095 Help() | 1093 Help() |
| 1096 return 0; | 1094 return 0; |
| 1097 | 1095 |
| 1098 try: | 1096 try: |
| 1099 # Create the directories where we store information about changelists if it | 1097 # Create the directories where we store information about changelists if it |
| 1100 # doesn't exist. | 1098 # doesn't exist. |
| 1101 if not os.path.exists(GetInfoDir()): | 1099 if not os.path.exists(GetInfoDir()): |
| 1102 os.mkdir(GetInfoDir()) | 1100 os.mkdir(GetInfoDir()) |
| 1103 if not os.path.exists(GetChangesDir()): | 1101 if not os.path.exists(GetChangesDir()): |
| 1104 os.mkdir(GetChangesDir()) | 1102 os.mkdir(GetChangesDir()) |
| 1105 # For smooth upgrade support, move the files in GetInfoDir() to | |
| 1106 # GetChangesDir(). | |
| 1107 # TODO(maruel): Remove this code in August 2009. | |
| 1108 for filename in os.listdir(unicode(GetInfoDir())): | |
| 1109 file_path = os.path.join(unicode(GetInfoDir()), filename) | |
| 1110 if os.path.isfile(file_path) and filename != CODEREVIEW_SETTINGS_FILE: | |
| 1111 shutil.move(file_path, GetChangesDir()) | |
| 1112 if not os.path.exists(GetCacheDir()): | 1103 if not os.path.exists(GetCacheDir()): |
| 1113 os.mkdir(GetCacheDir()) | 1104 os.mkdir(GetCacheDir()) |
| 1114 except gclient_utils.Error: | 1105 except gclient_utils.Error: |
| 1115 # Will throw an exception if not run in a svn checkout. | 1106 # Will throw an exception if not run in a svn checkout. |
| 1116 pass | 1107 pass |
| 1117 | 1108 |
| 1118 # Commands that don't require an argument. | 1109 # Commands that don't require an argument. |
| 1119 command = argv[1] | 1110 command = argv[1] |
| 1120 if command == "opened" or command == "status": | 1111 if command == "opened" or command == "status": |
| 1121 Opened(command == "status") | 1112 Opened(command == "status") |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 return 0 | 1192 return 0 |
| 1202 args =["svn", command] | 1193 args =["svn", command] |
| 1203 root = GetRepositoryRoot() | 1194 root = GetRepositoryRoot() |
| 1204 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1195 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
| 1205 RunShell(args, True) | 1196 RunShell(args, True) |
| 1206 return 0 | 1197 return 0 |
| 1207 | 1198 |
| 1208 | 1199 |
| 1209 if __name__ == "__main__": | 1200 if __name__ == "__main__": |
| 1210 sys.exit(main()) | 1201 sys.exit(main()) |
| OLD | NEW |