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

Side by Side Diff: git_cl.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 | « gcl.py ('k') | presubmit_support.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 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld.""" 8 """A git-command for integrating reviews on Rietveld."""
9 9
10 import json 10 import json
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 if e.code == 403: 735 if e.code == 403:
736 DieWithError( 736 DieWithError(
737 ('Access denied to issue %s. Maybe the patchset %s doesn\'t ' 737 ('Access denied to issue %s. Maybe the patchset %s doesn\'t '
738 'match?') % (self.GetIssue(), self.GetPatchset())) 738 'match?') % (self.GetIssue(), self.GetPatchset()))
739 raise 739 raise
740 740
741 def RpcServer(self): 741 def RpcServer(self):
742 """Returns an upload.RpcServer() to access this review's rietveld instance. 742 """Returns an upload.RpcServer() to access this review's rietveld instance.
743 """ 743 """
744 if not self._rpc_server: 744 if not self._rpc_server:
745 self._rpc_server = rietveld.Rietveld(self.GetRietveldServer(), 745 self._rpc_server = rietveld.CachingRietveld(
746 None, None) 746 self.GetRietveldServer(), None, None)
747 return self._rpc_server 747 return self._rpc_server
748 748
749 def _IssueSetting(self): 749 def _IssueSetting(self):
750 """Return the git setting that stores this change's issue.""" 750 """Return the git setting that stores this change's issue."""
751 return 'branch.%s.rietveldissue' % self.GetBranch() 751 return 'branch.%s.rietveldissue' % self.GetBranch()
752 752
753 def _PatchsetSetting(self): 753 def _PatchsetSetting(self):
754 """Return the git setting that stores this change's most recent patchset.""" 754 """Return the git setting that stores this change's most recent patchset."""
755 return 'branch.%s.rietveldpatchset' % self.GetBranch() 755 return 'branch.%s.rietveldpatchset' % self.GetBranch()
756 756
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) 1862 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)))
1863 1863
1864 # Not a known command. Default to help. 1864 # Not a known command. Default to help.
1865 GenUsage(parser, 'help') 1865 GenUsage(parser, 'help')
1866 return CMDhelp(parser, argv) 1866 return CMDhelp(parser, argv)
1867 1867
1868 1868
1869 if __name__ == '__main__': 1869 if __name__ == '__main__':
1870 fix_encoding.fix_encoding() 1870 fix_encoding.fix_encoding()
1871 sys.exit(main(sys.argv[1:])) 1871 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « gcl.py ('k') | presubmit_support.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698