OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 def _CommonChecks(input_api, output_api): | 52 def _CommonChecks(input_api, output_api): |
53 """Checks common to both upload and commit.""" | 53 """Checks common to both upload and commit.""" |
54 results = [] | 54 results = [] |
55 results.extend(input_api.canned_checks.CheckOwners( | 55 results.extend(input_api.canned_checks.CheckOwners( |
56 input_api, output_api, source_file_filter=None)) | 56 input_api, output_api, source_file_filter=None)) |
57 results.extend(_V8PresubmitChecks(input_api, output_api)) | 57 results.extend(_V8PresubmitChecks(input_api, output_api)) |
58 return results | 58 return results |
59 | 59 |
60 | 60 |
| 61 def _SkipTreeCheck(input_api, output_api): |
| 62 """Check the env var whether we want to skip tree check. |
| 63 Only skip if src/version.cc has been updated.""" |
| 64 src_version = 'src/version.cc' |
| 65 FilterFile = lambda file: file.LocalPath() == src_version |
| 66 if not input_api.AffectedSourceFiles( |
| 67 lambda file: file.LocalPath() == src_version): |
| 68 return False |
| 69 return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' |
| 70 |
| 71 |
61 def CheckChangeOnUpload(input_api, output_api): | 72 def CheckChangeOnUpload(input_api, output_api): |
62 results = [] | 73 results = [] |
63 results.extend(_CommonChecks(input_api, output_api)) | 74 results.extend(_CommonChecks(input_api, output_api)) |
64 return results | 75 return results |
65 | 76 |
66 | 77 |
67 def CheckChangeOnCommit(input_api, output_api): | 78 def CheckChangeOnCommit(input_api, output_api): |
68 results = [] | 79 results = [] |
69 results.extend(_CommonChecks(input_api, output_api)) | 80 results.extend(_CommonChecks(input_api, output_api)) |
70 results.extend(input_api.canned_checks.CheckChangeHasDescription( | 81 results.extend(input_api.canned_checks.CheckChangeHasDescription( |
71 input_api, output_api)) | 82 input_api, output_api)) |
72 results.extend(input_api.canned_checks.CheckTreeIsOpen( | 83 if not _SkipTreeCheck(input_api, output_api): |
73 input_api, output_api, | 84 results.extend(input_api.canned_checks.CheckTreeIsOpen( |
74 json_url='http://v8-status.appspot.com/current?format=json')) | 85 input_api, output_api, |
| 86 json_url='http://v8-status.appspot.com/current?format=json')) |
75 return results | 87 return results |
OLD | NEW |