Add gerrit.abandon_change command

R=tandrii@chromium.org

Bug: 935715
Change-Id: Ia7b8e2b187b59680270d694b24edf82493d1ed5c
Reviewed-on: https://chromium-review.googlesource.com/c/1487212
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
This commit is contained in:
Sergiy Belozorov
2019-02-27 15:07:33 +00:00
committed by Commit Bot
parent be28670fe2
commit fe34723a55
5 changed files with 81 additions and 0 deletions

View File

@@ -155,3 +155,23 @@ class GerritApi(recipe_api.RecipeApi):
step_test_data=step_test_data,
**kwargs
).json.output
def abandon_change(self, host, change, message=None, name=None,
step_test_data=None):
args = [
'abandon',
'--host', host,
'--change', int(change),
'--json_file', self.m.json.output(),
]
if message:
args.extend(['--message', message])
if not step_test_data:
step_test_data = lambda: self.test_api.get_one_change_response_data(
status='ABANDONED', _number=str(change))
return self(
name or 'abandon',
args,
step_test_data=step_test_data,
).json.output