Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_pull_request(self, repo, 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 repo: the repo of the pull-request
- :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())
- #request_url = 'https://pagure.io/api/0/carrot/pull-request/new'
- print(request_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)
- LOG.debug(return_value)
- return return_value
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement