MCPcopy
hub / github.com/treeverse/dvc / _pull

Function _pull

dvc/repo/experiments/pull.py:80–102  ·  view source on GitHub ↗
(
    repo,
    git_remote: str,
    refs: Iterable["ExpRefInfo"],
    force: bool,
)

Source from the content-addressed store, hash-verified

78
79
80def _pull(
81 repo,
82 git_remote: str,
83 refs: Iterable["ExpRefInfo"],
84 force: bool,
85) -> Mapping[SyncStatus, list["ExpRefInfo"]]:
86 refspec_list = [f"{exp_ref}:{exp_ref}" for exp_ref in refs]
87 logger.debug("git pull experiment '%s' -> '%s'", git_remote, refspec_list)
88
89 with TqdmGit(desc="Fetching git refs") as pbar:
90 results: Mapping[str, SyncStatus] = repo.scm.fetch_refspecs(
91 git_remote,
92 refspec_list,
93 force=force,
94 progress=pbar.update_git,
95 )
96
97 def group_result(refspec):
98 return results[str(refspec)]
99
100 pull_result: Mapping[SyncStatus, list[ExpRefInfo]] = group_by(group_result, refs)
101
102 return pull_result
103
104
105def _pull_cache(

Callers 1

pullFunction · 0.70

Calls 1

TqdmGitClass · 0.90

Tested by

no test coverage detected