diff options
author | Christian <cgumpert@users.noreply.github.com> | 2017-03-21 06:50:20 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-03-21 06:50:20 +0100 |
commit | 22bf12827387cb1719bacae6c0c745cd768eee6c (patch) | |
tree | 80fd22ecc95ec6f41fb442a0ddf5d6b551822ee0 /gitlab/cli.py | |
parent | 8677f1c0250e9ab6b1e16da17d593101128cf057 (diff) | |
download | gitlab-22bf12827387cb1719bacae6c0c745cd768eee6c.tar.gz |
Provide API wrapper for cherry picking commits (#236)
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 11 |
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) |