Example #1
0
def get_commits_unique_to_branch(repo_key, branch_name, sort):  # NOTE: This endpoint is a RestfulGit extension
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    if sort == "chronological":
        sort = GIT_SORT_TIME | GIT_SORT_REVERSE
    else:
        sort = GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE
    commits = list(_get_commits_unique_to_branch(repo, branch, sort))
    return {"commits": [convert_commit(repo_key, repo, commit) for commit in commits]}
Example #2
0
def get_merged_branches(repo_key, branch_name):  # NOTE: This endpoint is a RestfulGit extension
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    other_branches = (
        repo.lookup_branch(other_branch_name)
        for other_branch_name in repo.listall_branches()
        if other_branch_name != branch_name
    )
    merged_branches = (other_branch for other_branch in other_branches if _is_merged(repo, branch, other_branch))
    return [convert_branch_summary(repo_key, merged_branch) for merged_branch in merged_branches]
Example #3
0
def get_merged_branches(repo_key, branch_name):  # NOTE: This endpoint is a RestfulGit extension
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    other_branches = (
        repo.lookup_branch(other_branch_name)
        for other_branch_name in repo.listall_branches()
        if other_branch_name != branch_name
    )
    merged_branches = (other_branch for other_branch in other_branches if _is_merged(repo, branch, other_branch))
    return [convert_branch_summary(repo_key, merged_branch) for merged_branch in merged_branches]
Example #4
0
def get_commits_unique_to_branch(repo_key, branch_name, sort):  # NOTE: This endpoint is a RestfulGit extension
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    if sort == 'chronological':
        sort = GIT_SORT_TIME | GIT_SORT_REVERSE
    else:
        sort = GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE
    commits = list(_get_commits_unique_to_branch(repo, branch, sort))
    return {
        "commits": [convert_commit(repo_key, repo, commit) for commit in commits]
    }
Example #5
0
def get_branch(repo_key, branch_name):
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    return convert_branch_verbose(repo_key, repo, branch)
Example #6
0
def get_branch(repo_key, branch_name):
    repo = get_repo(repo_key)
    branch = _get_branch(repo, branch_name)
    return convert_branch(repo_key, repo, branch)