@ -426,8 +426,7 @@ def _get_bucket_map_for_builders(builders):
return bucket_map , None
return bucket_map , None
def _trigger_try_jobs ( auth_config , changelist , buckets , options ,
def _trigger_try_jobs ( auth_config , changelist , buckets , options , patchset ) :
category = ' git_cl_try ' , patchset = None ) :
""" Sends a request to Buildbucket to trigger try jobs for a changelist.
""" Sends a request to Buildbucket to trigger try jobs for a changelist.
Args :
Args :
@ -457,7 +456,7 @@ def _trigger_try_jobs(auth_config, changelist, buckets, options,
patch = patchset )
patch = patchset )
shared_parameters_properties = changelist . GetTryJobProperties ( patchset )
shared_parameters_properties = changelist . GetTryJobProperties ( patchset )
shared_parameters_properties [ ' category ' ] = category
shared_parameters_properties [ ' category ' ] = options. category
if options . clobber :
if options . clobber :
shared_parameters_properties [ ' clobber ' ] = True
shared_parameters_properties [ ' clobber ' ] = True
extra_properties = _get_properties_from_options ( options )
extra_properties = _get_properties_from_options ( options )
@ -5540,6 +5539,8 @@ def CMDtry(parser, args):
' -c ' , ' --clobber ' , action = ' store_true ' , default = False ,
' -c ' , ' --clobber ' , action = ' store_true ' , default = False ,
help = ' Force a clobber before building; that is don \' t do an '
help = ' Force a clobber before building; that is don \' t do an '
' incremental build ' )
' incremental build ' )
group . add_option (
' --category ' , default = ' git_cl_try ' , help = ' Specify custom build category. ' )
group . add_option (
group . add_option (
' --project ' ,
' --project ' ,
help = ' Override which project to use. Projects are defined '
help = ' Override which project to use. Projects are defined '
@ -5619,8 +5620,7 @@ def CMDtry(parser, args):
( patchset , cl . GetPatchset ( ) , patchset ) )
( patchset , cl . GetPatchset ( ) , patchset ) )
try :
try :
_trigger_try_jobs ( auth_config , cl , buckets , options , ' git_cl_try ' ,
_trigger_try_jobs ( auth_config , cl , buckets , options , patchset )
patchset )
except BuildbucketResponseException as ex :
except BuildbucketResponseException as ex :
print ( ' ERROR: %s ' % ex )
print ( ' ERROR: %s ' % ex )
return 1
return 1