Beispiel #1
0
def has_pending_updates(repo_info):
    repo = repo_info.repo
    at_least_one_fetch_was_successful = False

    logger.debug('Fetching updates for: {}'.format(repo_info.directory))
    for remote in repo.Network.Remotes:
        try:
            _fetch_remote(remote, repo_info)
            at_least_one_fetch_was_successful = True

        except git.PyRevitGitAuthenticationError:
            logger.debug(
                'Failed fetching updates. Can not login to repo to get updates: {}'
                .format(repo_info))
            continue

        except:
            logger.debug('Failed fetching updates: {}'.format(repo_info))
            continue

    if at_least_one_fetch_was_successful:
        hist_div = git.compare_branch_heads(repo_info)
        if hist_div.BehindBy > 0:
            return True

    return False
Beispiel #2
0
def has_pending_updates(repo_info):
    """Check for updates on repository.

    Args:
        repo_info (:obj:`pyrevit.coreutils.git.RepoInfo`):
            repository info wrapper object
    """
    if get_updates(repo_info):
        hist_div = libgit.compare_branch_heads(repo_info)
        if hist_div.BehindBy > 0:
            return True
Beispiel #3
0
def has_pending_updates(repo_info):
    if get_updates(repo_info):
        hist_div = git.compare_branch_heads(repo_info)
        if hist_div.BehindBy > 0:
            return True
Beispiel #4
0
def has_pending_updates(repo_info):
    """Check for updates on repository."""
    if get_updates(repo_info):
        hist_div = libgit.compare_branch_heads(repo_info)
        if hist_div.BehindBy > 0:
            return True