| |
@@ -571,6 +571,34 @@
|
| |
|
| |
return return_value["activities"]
|
| |
|
| |
+ def create_pull_request(self, title, branch_to, branch_from,
|
| |
+ initial_comment=None):
|
| |
+ """
|
| |
+ Create pull-request
|
| |
+ -------------------
|
| |
+ Open a new pull-request from this project to itself or its parent (if
|
| |
+ this project is a fork).
|
| |
+ :param title: the title to give the pull-request
|
| |
+ :param branch_to: the name of the branch the submitted changes should
|
| |
+ be merged into
|
| |
+ :param branch_from: the name of the branch containing the changes to merge
|
| |
+ :param initial_comment: the initial comment describing what these changes
|
| |
+ are about
|
| |
+ :return:
|
| |
+ """
|
| |
+ request_url = "{}pull-request/new".format(self.create_basic_url())
|
| |
+ payload = {
|
| |
+ "title": title,
|
| |
+ "branch_to": branch_to,
|
| |
+ "branch_from": branch_from,
|
| |
+ }
|
| |
+ if initial_comment is not None:
|
| |
+ payload["initial_comment"] = initial_comment
|
| |
+
|
| |
+ return_value = self._call_api(request_url, method="POST", data=payload)
|
| |
+
|
| |
+ return return_value
|
| |
+
|
| |
def list_pull_requests(self, username, page, status=None):
|
| |
"""
|
| |
List pull-requests filed by user.
|
| |
Adding a function to create a pull request.
Signed-off-by: Lenka Segura lenka@sepu.cz