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

Commit590ea0d

Browse files
author
Gauvain Pocentek
committed
Add support for merged branches deletion
1 parent4461139 commit590ea0d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

‎docs/gl_objects/branches.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ Protect/unprotect a repository branch::
4949
..code-block::python
5050
5151
branch.protect(developers_can_push=True,developers_can_merge=True)
52+
53+
Delete the merged branches for a project::
54+
55+
project.delete_merged_branches()

‎gitlab/v4/objects.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,6 +2811,21 @@ def delete_fork_relation(self, **kwargs):
28112811
path='/projects/%s/fork'%self.get_id()
28122812
self.manager.gitlab.http_delete(path,**kwargs)
28132813

2814+
@cli.register_custom_action('Project')
2815+
@exc.on_http_error(exc.GitlabDeleteError)
2816+
defdelete_merged_branches(self,**kwargs):
2817+
"""Delete merged branches.
2818+
2819+
Args:
2820+
**kwargs: Extra options to send to the server (e.g. sudo)
2821+
2822+
Raises:
2823+
GitlabAuthenticationError: If authentication is not correct
2824+
GitlabDeleteError: If the server failed to perform the request
2825+
"""
2826+
path='/projects/%s/repository/merged_branches'%self.get_id()
2827+
self.manager.gitlab.http_delete(path,**kwargs)
2828+
28142829
@cli.register_custom_action('Project')
28152830
@exc.on_http_error(exc.GitlabCreateError)
28162831
defstar(self,**kwargs):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp