mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Add 'create tag' support to gerrit_client and gerrit recipe_module.
BUG=1052179 R=dpranke@google.com, linxinan@chromium.org Change-Id: I6e220b70e63d990e9257d9fe4d107de7dbd2eb81 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3232849 Auto-Submit: Michael Moss <mmoss@chromium.org> Commit-Queue: Michael Moss <mmoss@chromium.org> Reviewed-by: Xinan Lin <linxinan@chromium.org> Reviewed-by: Dirk Pranke <dpranke@google.com>
This commit is contained in:
@@ -48,6 +48,25 @@ class GerritApi(recipe_api.RecipeApi):
|
||||
ref = step_result.json.output.get('ref')
|
||||
return ref
|
||||
|
||||
def create_gerrit_tag(self, host, project, tag, commit, **kwargs):
|
||||
"""Creates a new tag at the given commit.
|
||||
|
||||
Returns:
|
||||
The ref of the tag created.
|
||||
"""
|
||||
args = [
|
||||
'tag',
|
||||
'--host', host,
|
||||
'--project', project,
|
||||
'--tag', tag,
|
||||
'--commit', commit,
|
||||
'--json_file', self.m.json.output()
|
||||
]
|
||||
step_name = 'create_gerrit_tag (%s %s)' % (project, tag)
|
||||
step_result = self(step_name, args, **kwargs)
|
||||
ref = step_result.json.output.get('ref')
|
||||
return ref
|
||||
|
||||
# TODO(machenbach): Rename to get_revision? And maybe above to
|
||||
# create_ref?
|
||||
def get_gerrit_branch(self, host, project, branch, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user