Commit 70d11c37 authored by nodir's avatar nodir Committed by Commit bot

git_cl: fix GetPreferredTryMasters() feature

It was broken in https://chromiumcodereview.appspot.com/2419113002

R=borenet@chromium.org
BUG=658317

Review-Url: https://codereview.chromium.org/2442393002
parent 66cdab51
...@@ -4780,6 +4780,7 @@ def CMDtry(parser, args): ...@@ -4780,6 +4780,7 @@ def CMDtry(parser, args):
', e.g. "-m tryserver.chromium.linux".' % err_msg) ', e.g. "-m tryserver.chromium.linux".' % err_msg)
def GetMasterMap(): def GetMasterMap():
"""Returns {master: {builder_name: [test_names]}}. Not buckets!"""
# Process --bot. # Process --bot.
if not options.bot: if not options.bot:
change = cl.GetChange(cl.GetCommonAncestorWithUpstream(), None) change = cl.GetChange(cl.GetCommonAncestorWithUpstream(), None)
...@@ -4829,16 +4830,17 @@ def CMDtry(parser, args): ...@@ -4829,16 +4830,17 @@ def CMDtry(parser, args):
# Return a master map with one master to be backwards compatible. The # Return a master map with one master to be backwards compatible. The
# master name defaults to an empty string, which will cause the master # master name defaults to an empty string, which will cause the master
# not to be set on rietveld (deprecated). # not to be set on rietveld (deprecated).
bucket = '' return {options.master: builders_and_tests}
if options.master:
# Add the "master." prefix to the master name to obtain the bucket name.
bucket = _prefix_master(options.master)
return {bucket: builders_and_tests}
if options.bucket: if options.bucket:
buckets = {options.bucket: {b: [] for b in options.bot}} buckets = {options.bucket: {b: [] for b in options.bot}}
else: else:
buckets = GetMasterMap() buckets = {}
for master, data in GetMasterMap().iteritems():
# Add the "master." prefix to the master name to obtain the bucket name.
bucket = _prefix_master(master) if master else ''
buckets[bucket] = data
if not buckets: if not buckets:
# Default to triggering Dry Run (see http://crbug.com/625697). # Default to triggering Dry Run (see http://crbug.com/625697).
if options.verbose: if options.verbose:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment