diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index 14e691fb7..fcfb004d0 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -343,7 +343,7 @@ Returns: — **def [set\_change\_label](/recipes/recipe_modules/gerrit/api.py#248)(self, host, change, label_name, label_value, name=None, step_test_data=None):** -— **def [update\_files](/recipes/recipe_modules/gerrit/api.py#290)(self, host, project, branch, new_contents_by_file_path, commit_msg, params=frozenset(['status=NEW']), submit=False):** +— **def [update\_files](/recipes/recipe_modules/gerrit/api.py#290)(self, host, project, branch, new_contents_by_file_path, commit_msg, params=frozenset(['status=NEW']), submit=False, submit_later=False):** Update a set of files by creating and submitting a Gerrit CL. @@ -357,6 +357,9 @@ Args: * params: A list of additional ChangeInput specifiers, with format 'key=value'. * submit: Should land this CL instantly. + * submit_later: If this change has related CLs, we may want to commit + them in a chain. So only set Bot-Commit+1, making it ready for + submit together. Ignored if submit is True. Returns: A ChangeInfo dictionary as documented here: diff --git a/recipes/recipe_modules/gerrit/api.py b/recipes/recipe_modules/gerrit/api.py index be4dac2aa..38de53439 100644 --- a/recipes/recipe_modules/gerrit/api.py +++ b/recipes/recipe_modules/gerrit/api.py @@ -294,7 +294,8 @@ class GerritApi(recipe_api.RecipeApi): new_contents_by_file_path, commit_msg, params=frozenset(['status=NEW']), - submit=False): + submit=False, + submit_later=False): """Update a set of files by creating and submitting a Gerrit CL. Args: @@ -307,6 +308,9 @@ class GerritApi(recipe_api.RecipeApi): * params: A list of additional ChangeInput specifiers, with format 'key=value'. * submit: Should land this CL instantly. + * submit_later: If this change has related CLs, we may want to commit + them in a chain. So only set Bot-Commit+1, making it ready for + submit together. Ignored if submit is True. Returns: A ChangeInfo dictionary as documented here: @@ -361,7 +365,7 @@ class GerritApi(recipe_api.RecipeApi): change, ]) - if submit: + if submit or submit_later: self('set Bot-Commit+1 for change %d' % change, [ 'setbotcommit', '--host', @@ -369,6 +373,7 @@ class GerritApi(recipe_api.RecipeApi): '--change', change, ]) + if submit: submit_cmd = [ 'submitchange', '--host',