| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """\ | 6 """\ |
| 7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
| 8 of files. | 8 of files. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 self._description = None | 287 self._description = None |
| 288 self._subject = None | 288 self._subject = None |
| 289 self._reviewers = None | 289 self._reviewers = None |
| 290 self._set_description(description) | 290 self._set_description(description) |
| 291 if files is None: | 291 if files is None: |
| 292 files = [] | 292 files = [] |
| 293 self._files = files | 293 self._files = files |
| 294 self.patch = None | 294 self.patch = None |
| 295 self._local_root = local_root | 295 self._local_root = local_root |
| 296 self.needs_upload = needs_upload | 296 self.needs_upload = needs_upload |
| 297 self.rietveld = rietveld_url | 297 self.rietveld = gclient_utils.UpgradeToHttps( |
| 298 if not self.rietveld: | 298 rietveld_url or GetCodeReviewSetting('CODE_REVIEW_SERVER')) |
| 299 # Set the default value. | |
| 300 self.rietveld = GetCodeReviewSetting('CODE_REVIEW_SERVER') | |
| 301 self._rpc_server = None | 299 self._rpc_server = None |
| 302 | 300 |
| 303 def _get_description(self): | 301 def _get_description(self): |
| 304 return self._description | 302 return self._description |
| 305 | 303 |
| 306 def _set_description(self, description): | 304 def _set_description(self, description): |
| 307 # TODO(dpranke): Cloned from git_cl.py. These should be shared. | 305 # TODO(dpranke): Cloned from git_cl.py. These should be shared. |
| 308 if not description: | 306 if not description: |
| 309 self._description = description | 307 self._description = description |
| 310 return | 308 return |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 finally: | 1030 finally: |
| 1033 os.remove(commit_filename) | 1031 os.remove(commit_filename) |
| 1034 finally: | 1032 finally: |
| 1035 os.remove(targets_filename) | 1033 os.remove(targets_filename) |
| 1036 if output.find("Committed revision") != -1: | 1034 if output.find("Committed revision") != -1: |
| 1037 change_info.Delete() | 1035 change_info.Delete() |
| 1038 | 1036 |
| 1039 if change_info.issue: | 1037 if change_info.issue: |
| 1040 revision = re.compile(".*?\nCommitted revision (\d+)", | 1038 revision = re.compile(".*?\nCommitted revision (\d+)", |
| 1041 re.DOTALL).match(output).group(1) | 1039 re.DOTALL).match(output).group(1) |
| 1042 viewvc_url = GetCodeReviewSetting("VIEW_VC") | 1040 viewvc_url = gclient_utils.UpgradeToHttps(GetCodeReviewSetting('VIEW_VC')) |
| 1043 change_info.description += '\n' | 1041 change_info.description += '\n' |
| 1044 if viewvc_url: | 1042 if viewvc_url: |
| 1045 change_info.description += "\nCommitted: " + viewvc_url + revision | 1043 change_info.description += "\nCommitted: " + viewvc_url + revision |
| 1046 change_info.CloseIssue() | 1044 change_info.CloseIssue() |
| 1047 return 0 | 1045 return 0 |
| 1048 | 1046 |
| 1049 | 1047 |
| 1050 def CMDchange(args): | 1048 def CMDchange(args): |
| 1051 """Creates or edits a changelist. | 1049 """Creates or edits a changelist. |
| 1052 | 1050 |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1461 raise | 1459 raise |
| 1462 print >> sys.stderr, ( | 1460 print >> sys.stderr, ( |
| 1463 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1461 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 1464 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1462 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
| 1465 return 1 | 1463 return 1 |
| 1466 | 1464 |
| 1467 | 1465 |
| 1468 if __name__ == "__main__": | 1466 if __name__ == "__main__": |
| 1469 fix_encoding.fix_encoding() | 1467 fix_encoding.fix_encoding() |
| 1470 sys.exit(main(sys.argv[1:])) | 1468 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |