| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ad1c0dd commit bc4280c
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,3 +181,7 @@ Reset spent time for a merge request:: | |||
| 181 | 181 | Get user agent detail for the issue (admin only):: | |
| 182 | 182 | ||
| 183 | 183 | detail = issue.user_agent_detail() | |
| 184 | + | ||
| 185 | + Attempt to rebase an MR:: | ||
| 186 | + | ||
| 187 | + mr.rebase() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,6 +173,10 @@ class GitlabMRApprovalError(GitlabOperationError): | |||
| 173 | 173 | pass | |
| 174 | 174 | ||
| 175 | 175 | ||
| 176 | + class GitlabMRRebaseError(GitlabOperationError): | ||
| 177 | + pass | ||
| 178 | + | ||
| 179 | + | ||
| 176 | 180 | class GitlabMRClosedError(GitlabOperationError): | |
| 177 | 181 | pass | |
| 178 | 182 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2712,6 +2712,22 @@ def unapprove(self, **kwargs): | |||
| 2712 | 2712 | server_data = self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 2713 | 2713 | self._update_attrs(server_data) | |
| 2714 | 2714 | ||
| 2715 | + @cli.register_custom_action("ProjectMergeRequest") | ||
| 2716 | + @exc.on_http_error(exc.GitlabMRRebaseError) | ||
| 2717 | + def rebase(self, **kwargs): | ||
| 2718 | + """Attempt to rebase the source branch onto the target branch | ||
| 2719 | + | ||
| 2720 | + Args: | ||
| 2721 | + **kwargs: Extra options to send to the server (e.g. sudo) | ||
| 2722 | + | ||
| 2723 | + Raises: | ||
| 2724 | + GitlabAuthenticationError: If authentication is not correct | ||
| 2725 | + GitlabMRRebaseError: If rebasing failed | ||
| 2726 | + """ | ||
| 2727 | + path = "%s/%s/rebase" % (self.manager.path, self.get_id()) | ||
| 2728 | + data = {} | ||
| 2729 | + return self.manager.gitlab.http_put(path, post_data=data, **kwargs) | ||
| 2730 | + | ||
| 2715 | 2731 | @cli.register_custom_action( | |
| 2716 | 2732 | "ProjectMergeRequest", | |
| 2717 | 2733 | tuple(), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -686,6 +686,9 @@ | |||
| 686 | 686 | event = mr.resourcelabelevents.get(events[0].id) | |
| 687 | 687 | assert event | |
| 688 | 688 | ||
| 689 | + # rebasing | ||
| 690 | + assert mr.rebase() | ||
| 691 | + | ||
| 689 | 692 | # basic testing: only make sure that the methods exist | |
| 690 | 693 | mr.commits() | |
| 691 | 694 | mr.changes() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments