diff options
author | Max Wittig <max.wittig95@gmail.com> | 2019-07-21 18:13:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-21 18:13:24 +0200 |
commit | b9877b4e6479e66ca30a2908ee9c2703366eb9ce (patch) | |
tree | 3e1c2fc2d885fa5e7b664f20d1412174b1ca6a06 /gitlab/v4/objects.py | |
parent | c8a7e31cb57e3be7287ba237dbda7c4efa195b29 (diff) | |
parent | bc4280c2fbff115bd5e29a6f5012ae518610f626 (diff) | |
download | gitlab-b9877b4e6479e66ca30a2908ee9c2703366eb9ce.tar.gz |
Merge pull request #823 from jeroen92/rebase-mr
Resolve #822, add mr rebase
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r-- | gitlab/v4/objects.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index f72a145..c7edae6 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2712,6 +2712,22 @@ class ProjectMergeRequest( server_data = self.manager.gitlab.http_post(path, post_data=data, **kwargs) self._update_attrs(server_data) + @cli.register_custom_action("ProjectMergeRequest") + @exc.on_http_error(exc.GitlabMRRebaseError) + def rebase(self, **kwargs): + """Attempt to rebase the source branch onto the target branch + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabMRRebaseError: If rebasing failed + """ + path = "%s/%s/rebase" % (self.manager.path, self.get_id()) + data = {} + return self.manager.gitlab.http_put(path, post_data=data, **kwargs) + @cli.register_custom_action( "ProjectMergeRequest", tuple(), |