mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Repository.compare
This commit is contained in:
@@ -19,6 +19,9 @@ from PullRequest import *
|
||||
|
||||
__modifyAttributesForObjectsReferingRepo = { "_repo": lambda repo: repo }
|
||||
|
||||
def __compare( repo, base, head ):
|
||||
return repo._github._dataRequest( "GET", repo._baseUrl() + "/compare/" + base + "..." + head, None, None )
|
||||
|
||||
Repository = GithubObject(
|
||||
"Repository",
|
||||
BaseUrl( lambda obj: "/repos/" + obj.owner.login + "/" + obj.name ),
|
||||
@@ -136,4 +139,5 @@ Repository._addAttributePolicy( SeveralAttributePolicies( [
|
||||
ElementGetable( Parameters( [ "number" ], [] ), __modifyAttributesForObjectsReferingRepo ),
|
||||
ElementCreatable( Alternative( Parameters( [ "title", "body", "base", "head" ], [] ), Parameters( [ "issue", "base", "head" ], [] ) ), __modifyAttributesForObjectsReferingRepo ),
|
||||
),
|
||||
MethodFromCallable( "compare", Parameters( [ "base", "head" ], [] ), __compare, SimpleTypePolicy( None ) ),
|
||||
] ) )
|
||||
|
||||
Reference in New Issue
Block a user