Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
efiop committed Jan 24, 2024
1 parent 392ceb7 commit d0d1cd1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions dvc/fs/dvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,15 @@ def _prepare_credentials(self, **config) -> Dict[str, Any]:
def fs(self) -> "_DVCFileSystem":
return _DVCFileSystem(**self.fs_args)

@property
def immutable(self):
from dvc.scm import NoSCM

if isinstance(self.fs.repo.scm, NoSCM):
return False

return self.fs._repo_kwargs.get("rev") == self.fs.repo.get_rev()

def getcwd(self):
return self.fs.getcwd()

Expand Down
4 changes: 3 additions & 1 deletion dvc/repo/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def _load_storage_from_import(storage_map, key, out):
return

dep = out.stage.deps[0]
if not out.hash_info and (not dep.hash_info or dep.hash_info.name != storage_map[key].cache.odb.hash_name):
if not out.hash_info and (
not dep.hash_info or dep.hash_info.name != storage_map[key].cache.odb.hash_name
):
# partial import
fs_cache = out.repo.cache.fs_cache
storage_map.add_cache(
Expand Down
1 change: 1 addition & 0 deletions dvc/testing/workspace_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def test_import_dir(self, tmp_dir, dvc, remote_version_aware):
(remote_version_aware / "data_dir" / "new_file").write_text("new")
assert dvc.status().get("data_dir.dvc") == [
{"changed deps": {"remote://upstream/data_dir": "modified"}},
{"changed outs": {"data_dir": "not in cache"}},
]
dvc.update(str(tmp_dir / "data_dir.dvc"))
assert (tmp_dir / "data_dir" / "subdir" / "file").read_text() == "modified"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
"distro>=1.3",
"dpath<3,>=2.1.0",
# "dvc-data>=3.8,<3.9",
"dvc-data@git+https://github.com/efiop/dvc-data#egg=index-fetch-meta",
"dvc-data@git+https://github.com/efiop/dvc-data@index-fetch-meta",
"dvc-http>=2.29.0",
"dvc-render>=1.0.1,<2",
"dvc-studio-client>=0.17.1,<1",
Expand Down

0 comments on commit d0d1cd1

Please sign in to comment.