| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 changelist doesn't exist. | 404 changelist doesn't exist. |
| 405 update_status: if True, the svn status will be updated for all the files | 405 update_status: if True, the svn status will be updated for all the files |
| 406 and unchanged files will be removed. | 406 and unchanged files will be removed. |
| 407 | 407 |
| 408 Returns: a ChangeInfo object. | 408 Returns: a ChangeInfo object. |
| 409 """ | 409 """ |
| 410 info_file = GetChangelistInfoFile(changename) | 410 info_file = GetChangelistInfoFile(changename) |
| 411 if not os.path.exists(info_file): | 411 if not os.path.exists(info_file): |
| 412 if fail_on_not_found: | 412 if fail_on_not_found: |
| 413 ErrorExit("Changelist " + changename + " not found.") | 413 ErrorExit("Changelist " + changename + " not found.") |
| 414 return ChangeInfo(changename) | 414 return ChangeInfo(changename, 0, 0, '', None) |
| 415 split_data = ReadFile(info_file).split(ChangeInfo._SEPARATOR, 2) | 415 split_data = ReadFile(info_file).split(ChangeInfo._SEPARATOR, 2) |
| 416 if len(split_data) != 3: | 416 if len(split_data) != 3: |
| 417 ErrorExit("Changelist file %s is corrupt" % info_file) | 417 ErrorExit("Changelist file %s is corrupt" % info_file) |
| 418 items = split_data[0].split(',') | 418 items = split_data[0].split(',') |
| 419 issue = 0 | 419 issue = 0 |
| 420 patchset = 0 | 420 patchset = 0 |
| 421 if items[0]: | 421 if items[0]: |
| 422 issue = int(items[0]) | 422 issue = int(items[0]) |
| 423 if len(items) > 1: | 423 if len(items) > 1: |
| 424 patchset = int(items[1]) | 424 patchset = int(items[1]) |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 # the files. This allows commands such as 'gcl diff xxx' to work. | 1157 # the files. This allows commands such as 'gcl diff xxx' to work. |
| 1158 args =["svn", command] | 1158 args =["svn", command] |
| 1159 root = GetRepositoryRoot() | 1159 root = GetRepositoryRoot() |
| 1160 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1160 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
| 1161 RunShell(args, True) | 1161 RunShell(args, True) |
| 1162 return 0 | 1162 return 0 |
| 1163 | 1163 |
| 1164 | 1164 |
| 1165 if __name__ == "__main__": | 1165 if __name__ == "__main__": |
| 1166 sys.exit(main()) | 1166 sys.exit(main()) |
| OLD | NEW |