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

Feature/milestone merge requests#247

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
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
9 changes: 7 additions & 2 deletionsdocs/gl_objects/milestones.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,13 +30,18 @@
# state
# close a milestone
milestone.state_event = 'close'
milestone.save
milestone.save()

# activate a milestone
milestone.state_event = 'activate'
m.save()
milestone.save()
# end state

# issues
issues = milestone.issues()
# end issues

# merge_requests
merge_requests = milestone.merge_requests()
# end merge_requests

6 changes: 6 additions & 0 deletionsdocs/gl_objects/milestones.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,3 +53,9 @@ List the issues related to a milestone:
.. literalinclude:: milestones.py
:start-after: # issues
:end-before: # end issues

List the merge requests related to a milestone:

.. literalinclude:: milestones.py
:start-after: # merge_requests
:end-before: # end merge_requests
16 changes: 16 additions & 0 deletionsgitlab/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1858,6 +1858,22 @@ def issues(self, **kwargs):
{'project_id': self.project_id},
**kwargs)

def merge_requests(self, **kwargs):
"""List the merge requests related to this milestone

Returns:
list (ProjectMergeRequest): List of merge requests

Raises:
GitlabConnectionError: If the server cannot be reached.
GitlabListError: If the server fails to perform the request.
"""
url = ('/projects/%s/milestones/%s/merge_requests' %
(self.project_id, self.id))
return self.gitlab._raw_list(url, ProjectMergeRequest,
{'project_id': self.project_id},
**kwargs)


class ProjectMilestoneManager(BaseManager):
obj_cls = ProjectMilestone
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp