예제 #1
0
def iter_remote_refs(
    scm: "Git", url: str, base: Optional[str] = None, **kwargs
):
    from dvc.scm import GitAuthError, InvalidRemoteSCMRepo
    from dvc.scm.exceptions import AuthError, InvalidRemote

    try:
        yield from scm.iter_remote_refs(url, base=base, **kwargs)
    except InvalidRemote as exc:
        raise InvalidRemoteSCMRepo(str(exc))
    except AuthError as exc:
        raise GitAuthError(str(exc))
예제 #2
0
    def _validate_remotes(cls, dvc: "Repo", git_remote: Optional[str]):
        from dvc.scm import InvalidRemoteSCMRepo
        from dvc.scm.exceptions import InvalidRemote

        if git_remote == dvc.root_dir:
            logger.warning(
                f"'{git_remote}' points to the current Git repo, experiment "
                "Git refs will not be pushed. But DVC cache and run cache "
                "will automatically be pushed to the default DVC remote "
                "(if any) on each experiment commit.")
        try:
            dvc.scm.validate_git_remote(git_remote)
        except InvalidRemote as exc:
            raise InvalidRemoteSCMRepo(str(exc))
        dvc.cloud.get_remote_odb()