summaryrefslogtreecommitdiff
path: root/gitlab/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/cli.py')
-rw-r--r--gitlab/cli.py8
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)