| 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 """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 Loading... |
| 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 Loading... |
| 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)) |
| OLD | NEW |