fetched: correctly order mixed odbs (#6436)

This commit is contained in:
Batuhan Taskaya
2021-08-17 02:51:08 +03:00
committed by GitHub
parent c9b3d9dbae
commit b44e1c3646
2 changed files with 23 additions and 1 deletions
+2 -1
View File
@@ -61,7 +61,8 @@ def fetch(
for odb, obj_ids in sorted(
used.items(),
key=lambda item: item[0] and item[0].fs.scheme == Schemes.MEMORY,
key=lambda item: item[0] is not None
and item[0].fs.scheme == Schemes.MEMORY,
):
d, f = _fetch(
self,
+21
View File
@@ -350,6 +350,27 @@ def test_pull_external_dvc_imports(tmp_dir, dvc, scm, erepo_dir):
assert (tmp_dir / "new_dir" / "bar").read_text() == "bar"
def test_pull_external_dvc_imports_mixed(
tmp_dir, dvc, scm, erepo_dir, local_remote
):
with erepo_dir.chdir():
erepo_dir.dvc_gen("foo", "foo", commit="first")
os.remove("foo")
# imported: foo
dvc.imp(os.fspath(erepo_dir), "foo")
# local-object: bar
tmp_dir.dvc_gen("bar", "bar")
dvc.push("bar")
clean(["foo", "bar"], dvc)
assert dvc.pull()["fetched"] == 2
assert (tmp_dir / "foo").read_text() == "foo"
assert (tmp_dir / "bar").read_text() == "bar"
def clean(outs, dvc=None):
from tests.utils import clean_staging