Chromium Code Reviews| 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 __future__ import print_function | 10 from __future__ import print_function |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 def _get_bucket_map(changelist, options, option_parser): | 343 def _get_bucket_map(changelist, options, option_parser): |
| 344 """Returns a dict mapping bucket names to builders and tests, | 344 """Returns a dict mapping bucket names to builders and tests, |
| 345 for triggering try jobs. | 345 for triggering try jobs. |
| 346 """ | 346 """ |
| 347 # If no bots are listed, we try to get a set of builders and tests based | 347 # If no bots are listed, we try to get a set of builders and tests based |
| 348 # on GetPreferredTryMasters functions in PRESUBMIT.py files. | 348 # on GetPreferredTryMasters functions in PRESUBMIT.py files. |
| 349 if not options.bot: | 349 if not options.bot: |
| 350 change = changelist.GetChange( | 350 change = changelist.GetChange( |
| 351 changelist.GetCommonAncestorWithUpstream(), None) | 351 changelist.GetCommonAncestorWithUpstream(), None) |
| 352 # Get try masters from PRESUBMIT.py files. | 352 # Get try masters from PRESUBMIT.py files. |
| 353 return presubmit_support.DoGetTryMasters( | 353 masters = presubmit_support.DoGetTryMasters( |
| 354 change=change, | 354 change=change, |
| 355 changed_files=change.LocalPaths(), | 355 changed_files=change.LocalPaths(), |
| 356 repository_root=settings.GetRoot(), | 356 repository_root=settings.GetRoot(), |
| 357 default_presubmit=None, | 357 default_presubmit=None, |
| 358 project=None, | 358 project=None, |
| 359 verbose=options.verbose, | 359 verbose=options.verbose, |
| 360 output_stream=sys.stdout) | 360 output_stream=sys.stdout) |
| 361 return {MASTER_PREFIX + m: b for m, b in masters.iteritems()} | |
|
qyearsley
2016/11/04 22:02:52
Could be changed to:
return {_prefix_master(m): b
nodir
2016/11/04 22:04:04
I don't like _prefix_master. It assumes that no ma
| |
| 361 | 362 |
| 362 if options.bucket: | 363 if options.bucket: |
| 363 return {options.bucket: {b: [] for b in options.bot}} | 364 return {options.bucket: {b: [] for b in options.bot}} |
| 364 if options.master: | 365 if options.master: |
| 365 return {_prefix_master(options.master): {b: [] for b in options.bot}} | 366 return {_prefix_master(options.master): {b: [] for b in options.bot}} |
| 366 | 367 |
| 367 # If bots are listed but no master or bucket, then we need to find out | 368 # If bots are listed but no master or bucket, then we need to find out |
| 368 # the corresponding master for each bot. | 369 # the corresponding master for each bot. |
| 369 bucket_map, error_message = _get_bucket_map_for_builders(options.bot) | 370 bucket_map, error_message = _get_bucket_map_for_builders(options.bot) |
| 370 if error_message: | 371 if error_message: |
| (...skipping 5015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5386 if __name__ == '__main__': | 5387 if __name__ == '__main__': |
| 5387 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5388 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 5388 # unit testing. | 5389 # unit testing. |
| 5389 fix_encoding.fix_encoding() | 5390 fix_encoding.fix_encoding() |
| 5390 setup_color.init() | 5391 setup_color.init() |
| 5391 try: | 5392 try: |
| 5392 sys.exit(main(sys.argv[1:])) | 5393 sys.exit(main(sys.argv[1:])) |
| 5393 except KeyboardInterrupt: | 5394 except KeyboardInterrupt: |
| 5394 sys.stderr.write('interrupted\n') | 5395 sys.stderr.write('interrupted\n') |
| 5395 sys.exit(1) | 5396 sys.exit(1) |
| OLD | NEW |