diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-03-22 18:32:31 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-03-22 18:32:31 +0100 |
commit | f6a51d67c38c883775240d8c612d492bf023c2e4 (patch) | |
tree | 8f739be485d3b37a47b62acb026cc7a6e513274d /gitlab/cli.py | |
parent | ccbea3f59a1be418ea5adf90d25dbfb49f72dfde (diff) | |
download | gitlab-f6a51d67c38c883775240d8c612d492bf023c2e4.tar.gz |
MR: add support for cancel_merge_when_build_succeeds
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r-- | gitlab/cli.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gitlab/cli.py b/gitlab/cli.py index 91c45a0..efa2d76 100644 --- a/gitlab/cli.py +++ b/gitlab/cli.py @@ -42,6 +42,7 @@ EXTRA_ACTIONS = { 'filepath']}, 'builds': {'required': ['id', 'project-id']}}, gitlab.ProjectMergeRequest: { + 'cancel': {'required': ['id', 'project-id']}, 'merge': {'required': ['id', 'project-id'], 'optional': ['merge-commit-message', 'should-remove-source-branch', @@ -223,6 +224,13 @@ class GitlabCLI(object): except Exception as e: _die("Impossible to retry project build (%s)" % str(e)) + def do_project_merge_request_cancel(self, cls, gl, what, args): + try: + o = self.do_get(cls, gl, what, args) + return o.cancel_merge_when_build_succeeds() + except Exception as e: + _die("Impossible to cancel merge request (%s)" % str(e)) + def do_project_merge_request_merge(self, cls, gl, what, args): try: o = self.do_get(cls, gl, what, args) |