| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 gclient_utils.FileWrite(GetChangelistInfoFile(self.name), data) | 356 gclient_utils.FileWrite(GetChangelistInfoFile(self.name), data) |
| 357 | 357 |
| 358 def Delete(self): | 358 def Delete(self): |
| 359 """Removes the changelist information from disk.""" | 359 """Removes the changelist information from disk.""" |
| 360 os.remove(GetChangelistInfoFile(self.name)) | 360 os.remove(GetChangelistInfoFile(self.name)) |
| 361 | 361 |
| 362 def RpcServer(self): | 362 def RpcServer(self): |
| 363 if not self._rpc_server: | 363 if not self._rpc_server: |
| 364 if not self.rietveld: | 364 if not self.rietveld: |
| 365 ErrorExit(CODEREVIEW_SETTINGS_FILE_NOT_FOUND) | 365 ErrorExit(CODEREVIEW_SETTINGS_FILE_NOT_FOUND) |
| 366 self._rpc_server = rietveld.Rietveld(self.rietveld, None, None) | 366 self._rpc_server = rietveld.CachingRietveld(self.rietveld, None, None) |
| 367 return self._rpc_server | 367 return self._rpc_server |
| 368 | 368 |
| 369 def CloseIssue(self): | 369 def CloseIssue(self): |
| 370 """Closes the Rietveld issue for this changelist.""" | 370 """Closes the Rietveld issue for this changelist.""" |
| 371 # Newer versions of Rietveld require us to pass an XSRF token to POST, so | 371 # Newer versions of Rietveld require us to pass an XSRF token to POST, so |
| 372 # we fetch it from the server. | 372 # we fetch it from the server. |
| 373 xsrf_token = self.SendToRietveld( | 373 xsrf_token = self.SendToRietveld( |
| 374 '/xsrf_token', | 374 '/xsrf_token', |
| 375 extra_headers={'X-Requesting-XSRF-Token': '1'}) | 375 extra_headers={'X-Requesting-XSRF-Token': '1'}) |
| 376 | 376 |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1457 raise | 1457 raise |
| 1458 print >> sys.stderr, ( | 1458 print >> sys.stderr, ( |
| 1459 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1459 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 1460 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1460 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
| 1461 return 1 | 1461 return 1 |
| 1462 | 1462 |
| 1463 | 1463 |
| 1464 if __name__ == "__main__": | 1464 if __name__ == "__main__": |
| 1465 fix_encoding.fix_encoding() | 1465 fix_encoding.fix_encoding() |
| 1466 sys.exit(main(sys.argv[1:])) | 1466 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |