index: use out.hash_info for complete imports

This commit is contained in:
Ruslan Kuprieiev
2023-06-12 16:55:36 +03:00
parent cf59d801ce
commit 1af150a5e9
3 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -136,7 +136,11 @@ def _load_data_from_outs(index, prefix, outs):
if out.stage.is_import and not out.stage.is_repo_import:
dep = out.stage.deps[0]
entry.meta = dep.meta
entry.hash_info = dep.hash_info
if out.hash_info:
entry.hash_info = out.hash_info
else:
# partial import
entry.hash_info = dep.hash_info
# FIXME PyGTrie-based DataIndex doesn't remove entry.key during
# index.add, so we have to set the entry manually here to make
+2
View File
@@ -150,6 +150,8 @@ class TestImportURLVersionAware:
dvc.pull()
assert (tmp_dir / "data_dir" / "subdir" / "file").read_text() == "file"
dvc.commit(force=True)
assert dvc.status() == {}
+1 -1
View File
@@ -34,7 +34,7 @@ dependencies = [
"configobj>=5.0.6",
"distro>=1.3",
"dpath<3,>=2.1.0",
"dvc-data>=1.7.0,<1.8.0",
"dvc-data>=1.8.0,<1.9.0",
"dvc-http>=2.29.0",
"dvc-render>=0.3.1,<1",
"dvc-studio-client>=0.9.2,<1",