From 0f64b16fcff8c9628c94ea2a08e1ce3b9ea24353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Tue, 12 Jul 2011 11:37:44 +0200 Subject: [PATCH 1/2] cleared documentation for the project parameter --- github2/pull_requests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github2/pull_requests.py b/github2/pull_requests.py index fe8ef1b..c4186b6 100644 --- a/github2/pull_requests.py +++ b/github2/pull_requests.py @@ -53,7 +53,7 @@ def create(self, project, base, head, title=None, body=None, issue=None): issue. If an ``issue`` parameter is supplied the pull request is attached to that issue, else a new pull request is created. - :param str project: Github project + :param str project: the Github project to send the pull request to :param str base: branch changes should be pulled into :param str head: branch of the changes to be pulled :param str title: title for pull request From d6e78063bfe2a66c2da43171d308f718a72cc400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Ar=C8=9B=C4=83ri=C8=99i?= Date: Tue, 12 Jul 2011 11:41:19 +0200 Subject: [PATCH 2/2] raise TypeError when creating pull requests if one of the alternative arguments is not given --- github2/pull_requests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/github2/pull_requests.py b/github2/pull_requests.py index c4186b6..09f92e5 100644 --- a/github2/pull_requests.py +++ b/github2/pull_requests.py @@ -67,6 +67,10 @@ def create(self, project, base, head, title=None, body=None, issue=None): post_data["title"] = title if body: post_data["body"] = body + else: + raise TypeError("You must either specify a title for the " + "pull request or an issue number to which the " + "pull request should be attached.") pull_request_data = [("pull[%s]" % k, v) for k, v in post_data.items()] return self.get_value(project, post_data=dict(pull_request_data), filter="pull", datatype=PullRequest)