Ejemplo n.º 1
0
def merge(username, repository_name):
    repo = Repository(username, repository_name)
    requests = repo.getPullRequests()
    for request in requests:
        if request.validate():
            click.echo("Merging PR#%s" % (request.number, ))
            request.vote_merge()
Ejemplo n.º 2
0
def close(username, repository_name):
    repo = Repository(username, repository_name)
    requests = repo.getPullRequests()
    for request in requests:
        if request.isBlocked():
            continue
        if request.shouldClose():
            click.echo("Closing PR#%s" % (request.number, ))
            request.close()
Ejemplo n.º 3
0
def info(username, repository_name, pull_request):
    repo = Repository(username, repository_name)
    request = repo.getPullRequest(pull_request)
    click.echo("PR#%s: %s" % (request.number, request.pr.title))
    consensus = repo.getConsensus()
    click.echo("Mergeable:  %s" % (consensus.isMergeable(request), ))
    click.echo("Is Blocked: %s" % (request.isBlocked(), ))
    click.echo("Has Quorum: %s" % (consensus.hasQuorum(request), ))
    click.echo("Has Votes:  %s" % (consensus.hasVotes(request), ))
    click.echo("Has Aged:   %s" % (consensus.hasAged(request), ))
Ejemplo n.º 4
0
def get_repository(username, repository_name):
    credentials = config.getGitToken()
    client = github3.login(token=credentials['token'])
    return Repository(username, repository_name, client)
Ejemplo n.º 5
0
def forceclose(username, repository_name, pull_request):
    repo = Repository(username, repository_name)
    request = repo.getPullRequest(pull_request)
    click.echo("PR#%s: %s" % (request.number, request.pr.title))
    request.close()
Ejemplo n.º 6
0
def list(username, repository_name):
    repo = Repository(username, repository_name)
    requests = repo.getPullRequests()
    for request in requests:
        click.echo("PR#%s: %s" % (request.number, request.validate()))
Ejemplo n.º 7
0
 def get_repository(self, username, repository_name):
     client = self.get_github3_client()
     return Repository(username, repository_name, client)