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

Side by Side Diff: presubmit_support.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 | « git_cl.py ('k') | rietveld.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 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.6.1' 9 __version__ = '1.6.1'
10 10
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 elif options.verbose: 1230 elif options.verbose:
1231 logging.basicConfig(level=logging.INFO) 1231 logging.basicConfig(level=logging.INFO)
1232 else: 1232 else:
1233 logging.basicConfig(level=logging.ERROR) 1233 logging.basicConfig(level=logging.ERROR)
1234 change_class, files = load_files(options, args) 1234 change_class, files = load_files(options, args)
1235 if not change_class: 1235 if not change_class:
1236 parser.error('For unversioned directory, <files> is not optional.') 1236 parser.error('For unversioned directory, <files> is not optional.')
1237 logging.info('Found %d file(s).' % len(files)) 1237 logging.info('Found %d file(s).' % len(files))
1238 rietveld_obj = None 1238 rietveld_obj = None
1239 if options.rietveld_url: 1239 if options.rietveld_url:
1240 rietveld_obj = rietveld.Rietveld( 1240 rietveld_obj = rietveld.CachingRietveld(
1241 options.rietveld_url, 1241 options.rietveld_url,
1242 options.rietveld_email, 1242 options.rietveld_email,
1243 options.rietveld_password) 1243 options.rietveld_password)
1244 try: 1244 try:
1245 results = DoPresubmitChecks( 1245 results = DoPresubmitChecks(
1246 change_class(options.name, 1246 change_class(options.name,
1247 options.description, 1247 options.description,
1248 options.root, 1248 options.root,
1249 files, 1249 files,
1250 options.issue, 1250 options.issue,
(...skipping 10 matching lines...) Expand all
1261 except PresubmitFailure, e: 1261 except PresubmitFailure, e:
1262 print >> sys.stderr, e 1262 print >> sys.stderr, e
1263 print >> sys.stderr, 'Maybe your depot_tools is out of date?' 1263 print >> sys.stderr, 'Maybe your depot_tools is out of date?'
1264 print >> sys.stderr, 'If all fails, contact maruel@' 1264 print >> sys.stderr, 'If all fails, contact maruel@'
1265 return 2 1265 return 2
1266 1266
1267 1267
1268 if __name__ == '__main__': 1268 if __name__ == '__main__':
1269 fix_encoding.fix_encoding() 1269 fix_encoding.fix_encoding()
1270 sys.exit(Main(None)) 1270 sys.exit(Main(None))
OLDNEW
« no previous file with comments | « git_cl.py ('k') | rietveld.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698