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

Side by Side Diff: git_cl.py

Issue 2482523002: fix git-cl-try without parameters (Closed)
Patch Set: masters can be None Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | 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 # 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
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 if masters is None:
362 return None
363 return {MASTER_PREFIX + m: b for m, b in masters.iteritems()}
361 364
362 if options.bucket: 365 if options.bucket:
363 return {options.bucket: {b: [] for b in options.bot}} 366 return {options.bucket: {b: [] for b in options.bot}}
364 if options.master: 367 if options.master:
365 return {_prefix_master(options.master): {b: [] for b in options.bot}} 368 return {_prefix_master(options.master): {b: [] for b in options.bot}}
366 369
367 # If bots are listed but no master or bucket, then we need to find out 370 # If bots are listed but no master or bucket, then we need to find out
368 # the corresponding master for each bot. 371 # the corresponding master for each bot.
369 bucket_map, error_message = _get_bucket_map_for_builders(options.bot) 372 bucket_map, error_message = _get_bucket_map_for_builders(options.bot)
370 if error_message: 373 if error_message:
(...skipping 5015 matching lines...) Expand 10 before | Expand all | Expand 10 after
5386 if __name__ == '__main__': 5389 if __name__ == '__main__':
5387 # These affect sys.stdout so do it outside of main() to simplify mocks in 5390 # These affect sys.stdout so do it outside of main() to simplify mocks in
5388 # unit testing. 5391 # unit testing.
5389 fix_encoding.fix_encoding() 5392 fix_encoding.fix_encoding()
5390 setup_color.init() 5393 setup_color.init()
5391 try: 5394 try:
5392 sys.exit(main(sys.argv[1:])) 5395 sys.exit(main(sys.argv[1:]))
5393 except KeyboardInterrupt: 5396 except KeyboardInterrupt:
5394 sys.stderr.write('interrupted\n') 5397 sys.stderr.write('interrupted\n')
5395 sys.exit(1) 5398 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698