leeroy/github.py
def get_build_commits(app, repo_config):
    """
    Determine the value for BUILD_COMMITS from the app and repository
    config. Resolves the previous BUILD_ALL_COMMITS = True/False option
    to BUILD_COMMITS = 'ALL'/'LAST' respectively.
    """
    build_commits = repo_config.get("build_commits")
    build_all_commits = repo_config.get("build_all_commits",
                                        app.config.get("BUILD_ALL_COMMITS"))

    if not build_commits and build_all_commits is not None:
        # Determine BUILD_COMMITS from legacy BUILD_ALL_COMMITS
        if build_all_commits:
            build_commits = BUILD_COMMITS_ALL
        else:
            build_commits = BUILD_COMMITS_LAST
        warnings.warn("BUILD_ALL_COMMITS is deprecated. Use the BUILD_COMMITS "
                      "setting instead.", DeprecationWarning)
    elif not build_commits:
        # Determine BUILD_COMMITS from global app config.
        build_commits = app.config["BUILD_COMMITS"]
    return build_commits
def get_build_commits(app, repo_config):
    """
    Determine the value for BUILD_COMMITS from the app and repository
    config. Resolves the previous BUILD_ALL_COMMITS = True/False option
    to BUILD_COMMITS = 'ALL'/'LAST' respectively.
    """
    build_commits = repo_config.get("build_commits")
    build_all_commits = repo_config.get("build_all_commits",
                                        app.config.get("BUILD_ALL_COMMITS"))

    if not build_commits and build_all_commits is not None:
        # Determine BUILD_COMMITS from legacy BUILD_ALL_COMMITS
        if build_all_commits:
            build_commits = BUILD_COMMITS_ALL
        else:
            build_commits = BUILD_COMMITS_LAST
        warnings.warn("BUILD_ALL_COMMITS is deprecated. Use the BUILD_COMMITS "
                      "setting instead.", DeprecationWarning)
    elif not build_commits:
        # Determine BUILD_COMMITS from global app config.
        build_commits = app.config["BUILD_COMMITS"]
    return build_commits
Determine the value for BUILD_COMMITS from the app and repository
    config. Resolves the previous BUILD_ALL_COMMITS = True/False option
    to BUILD_COMMITS = 'ALL'/'LAST' respectively.