| 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 # 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 and Gerrit.""" | 8 """A git-command for integrating reviews on Rietveld and Gerrit.""" |
| 9 | 9 |
| 10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 'category': category, | 330 'category': category, |
| 331 'issue': issue, | 331 'issue': issue, |
| 332 'master': master, | 332 'master': master, |
| 333 'patch_project': issue_props['project'], | 333 'patch_project': issue_props['project'], |
| 334 'patch_storage': 'rietveld', | 334 'patch_storage': 'rietveld', |
| 335 'patchset': patchset, | 335 'patchset': patchset, |
| 336 'reason': options.name, | 336 'reason': options.name, |
| 337 'rietveld': rietveld_url, | 337 'rietveld': rietveld_url, |
| 338 }, | 338 }, |
| 339 } | 339 } |
| 340 if 'presubmit' in builder.lower(): | |
| 341 parameters['properties']['dry_run'] = 'true' | |
| 342 if tests: | 340 if tests: |
| 343 parameters['properties']['testfilter'] = tests | 341 parameters['properties']['testfilter'] = tests |
| 344 if properties: | 342 if properties: |
| 345 parameters['properties'].update(properties) | 343 parameters['properties'].update(properties) |
| 346 if options.clobber: | 344 if options.clobber: |
| 347 parameters['properties']['clobber'] = True | 345 parameters['properties']['clobber'] = True |
| 348 batch_req_body['builds'].append( | 346 batch_req_body['builds'].append( |
| 349 { | 347 { |
| 350 'bucket': bucket, | 348 'bucket': bucket, |
| 351 'parameters_json': json.dumps(parameters), | 349 'parameters_json': json.dumps(parameters), |
| (...skipping 3959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 # location. | 4309 # location. |
| 4312 cq_cfg = os.path.join(change.RepositoryRoot(), | 4310 cq_cfg = os.path.join(change.RepositoryRoot(), |
| 4313 'infra', 'config', 'cq.cfg') | 4311 'infra', 'config', 'cq.cfg') |
| 4314 if os.path.exists(cq_cfg): | 4312 if os.path.exists(cq_cfg): |
| 4315 masters = {} | 4313 masters = {} |
| 4316 cq_masters = commit_queue.get_master_builder_map( | 4314 cq_masters = commit_queue.get_master_builder_map( |
| 4317 cq_cfg, include_experimental=False, include_triggered=False) | 4315 cq_cfg, include_experimental=False, include_triggered=False) |
| 4318 for master, builders in cq_masters.iteritems(): | 4316 for master, builders in cq_masters.iteritems(): |
| 4319 for builder in builders: | 4317 for builder in builders: |
| 4320 # Skip presubmit builders, because these will fail without LGTM. | 4318 # Skip presubmit builders, because these will fail without LGTM. |
| 4321 masters.setdefault(master, {})[builder] = ['defaulttests'] | 4319 if 'presubmit' not in builder.lower(): |
| 4320 masters.setdefault(master, {})[builder] = ['defaulttests'] |
| 4322 if masters: | 4321 if masters: |
| 4323 return masters | 4322 return masters |
| 4324 | 4323 |
| 4325 if not options.bot: | 4324 if not options.bot: |
| 4326 parser.error('No default try builder to try, use --bot') | 4325 parser.error('No default try builder to try, use --bot') |
| 4327 | 4326 |
| 4328 builders_and_tests = {} | 4327 builders_and_tests = {} |
| 4329 # TODO(machenbach): The old style command-line options don't support | 4328 # TODO(machenbach): The old style command-line options don't support |
| 4330 # multiple try masters yet. | 4329 # multiple try masters yet. |
| 4331 old_style = filter(lambda x: isinstance(x, basestring), options.bot) | 4330 old_style = filter(lambda x: isinstance(x, basestring), options.bot) |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4855 if __name__ == '__main__': | 4854 if __name__ == '__main__': |
| 4856 # These affect sys.stdout so do it outside of main() to simplify mocks in | 4855 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 4857 # unit testing. | 4856 # unit testing. |
| 4858 fix_encoding.fix_encoding() | 4857 fix_encoding.fix_encoding() |
| 4859 setup_color.init() | 4858 setup_color.init() |
| 4860 try: | 4859 try: |
| 4861 sys.exit(main(sys.argv[1:])) | 4860 sys.exit(main(sys.argv[1:])) |
| 4862 except KeyboardInterrupt: | 4861 except KeyboardInterrupt: |
| 4863 sys.stderr.write('interrupted\n') | 4862 sys.stderr.write('interrupted\n') |
| 4864 sys.exit(1) | 4863 sys.exit(1) |
| OLD | NEW |