Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: gcl.py

Issue 11280143: Create CachingRietveld to automatically cache results for presubmit checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: add tests Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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:]))
OLDNEW
« no previous file with comments | « no previous file | git_cl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698