summaryrefslogtreecommitdiff
path: root/gitlab/cli.py
diff options
context:
space:
mode:
authorChristian <cgumpert@users.noreply.github.com>2017-03-21 06:50:20 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-03-21 06:50:20 +0100
commit22bf12827387cb1719bacae6c0c745cd768eee6c (patch)
tree80fd22ecc95ec6f41fb442a0ddf5d6b551822ee0 /gitlab/cli.py
parent8677f1c0250e9ab6b1e16da17d593101128cf057 (diff)
downloadgitlab-22bf12827387cb1719bacae6c0c745cd768eee6c.tar.gz
Provide API wrapper for cherry picking commits (#236)
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r--gitlab/cli.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py
index 32b3ec8..2a41907 100644
--- a/gitlab/cli.py
+++ b/gitlab/cli.py
@@ -42,7 +42,9 @@ EXTRA_ACTIONS = {
gitlab.ProjectCommit: {'diff': {'required': ['id', 'project-id']},
'blob': {'required': ['id', 'project-id',
'filepath']},
- 'builds': {'required': ['id', 'project-id']}},
+ 'builds': {'required': ['id', 'project-id']},
+ 'cherrypick': {'required': ['id', 'project-id',
+ 'branch']}},
gitlab.ProjectIssue: {'subscribe': {'required': ['id', 'project-id']},
'unsubscribe': {'required': ['id', 'project-id']},
'move': {'required': ['id', 'project-id',
@@ -267,6 +269,13 @@ class GitlabCLI(object):
except Exception as e:
_die("Impossible to get commit builds", e)
+ def do_project_commit_cherrypick(self, cls, gl, what, args):
+ try:
+ o = self.do_get(cls, gl, what, args)
+ o.cherry_pick(branch=args['branch'])
+ except Exception as e:
+ _die("Impossible to cherry-pick commit", e)
+
def do_project_build_cancel(self, cls, gl, what, args):
try:
o = self.do_get(cls, gl, what, args)