Skip to content

Commit

Permalink
checkout: move to objects (iterative#6721)
Browse files Browse the repository at this point in the history
Checkout operation is pretty much the opposite of staging, so it too belongs in objects.
  • Loading branch information
efiop authored Sep 30, 2021
1 parent 9a1d740 commit f46beb4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dvc/dependency/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def dumpd(self):
return {self.PARAM_PATH: self.def_path, self.PARAM_REPO: self.def_repo}

def download(self, to, jobs=None):
from dvc.checkout import checkout
from dvc.objects.checkout import checkout

for odb, objs in self.get_used_objs().items():
self.repo.cloud.pull(objs, jobs=jobs, odb=odb)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion dvc/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
from voluptuous import And, Any, Coerce, Length, Lower, Required, SetTo

from dvc import objects, prompt
from dvc.checkout import checkout
from dvc.exceptions import (
CheckoutError,
CollectCacheError,
DvcException,
MergeError,
RemoteCacheRequiredError,
)
from dvc.objects.checkout import checkout

from .fs import get_cloud_fs
from .fs.hdfs import HDFSFileSystem
Expand Down
3 changes: 2 additions & 1 deletion tests/func/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ def test_add_with_cache_link_error(tmp_dir, dvc, mocker, capsys):
tmp_dir.gen("foo", "foo")

mocker.patch(
"dvc.checkout._do_link", side_effect=DvcException("link failed")
"dvc.objects.checkout._do_link",
side_effect=DvcException("link failed"),
)
dvc.add("foo")
err = capsys.readouterr()[1]
Expand Down

0 comments on commit f46beb4

Please sign in to comment.