Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Resolve #822, add mr rebase#823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intopython-gitlab:masterfromjeroen92:rebase-mr
Jul 21, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletionsdocs/gl_objects/mrs.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -181,3 +181,7 @@ Reset spent time for a merge request::
Get user agent detail for the issue (admin only)::

detail = issue.user_agent_detail()

Attempt to rebase an MR::

mr.rebase()
4 changes: 4 additions & 0 deletionsgitlab/exceptions.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -173,6 +173,10 @@ class GitlabMRApprovalError(GitlabOperationError):
pass


class GitlabMRRebaseError(GitlabOperationError):
pass


class GitlabMRClosedError(GitlabOperationError):
pass

Expand Down
16 changes: 16 additions & 0 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2712,6 +2712,22 @@ def unapprove(self, **kwargs):
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(),
Expand Down
3 changes: 3 additions & 0 deletionstools/python_test_v4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -686,6 +686,9 @@
event=mr.resourcelabelevents.get(events[0].id)
assertevent

# rebasing
assertmr.rebase()

# basic testing: only make sure that the methods exist
mr.commits()
mr.changes()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp