def init_cache(self, repo: "Repo", rev: str, run_cache: bool = True): from dvc.repo.push import push with self.get_odb() as odb: push( repo, revs=[rev], run_cache=run_cache, odb=odb, include_imports=True, )
def init_cache(self, dvc: "Repo", rev: str, run_cache: bool = True): from dvc.objects.db import ODBManager, get_odb from dvc.repo import Repo from dvc.repo.push import push cache_path = posixpath.join( self._repo_abspath, Repo.DVC_DIR, ODBManager.CACHE_DIR, ) with self.sshfs() as fs: odb = get_odb(fs, cache_path, **fs.config) push(dvc, revs=[rev], run_cache=run_cache, odb=odb)