Skip to content

Commit

Permalink
meta.from_info: use positional args (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Aug 13, 2024
1 parent b3e73b0 commit 8a9033d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/dvc_data/hashfile/checkout.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def checkout( # noqa: PLR0913
except CheckoutError as exc:
failed.extend(exc.paths)

if diff and state:
if (diff or relink) and state:
state.save_link(path, fs)

if failed or not diff:
Expand Down
27 changes: 14 additions & 13 deletions src/dvc_data/hashfile/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,20 @@ def from_info(cls, info: dict[str, Any], protocol: Optional[str] = None) -> "Met
version_id = info.get("generation")

return Meta(
isdir=info["type"] == "directory",
size=info.get("size"),
isexec=is_exec(info.get("mode", 0)),
version_id=version_id,
etag=etag,
checksum=checksum,
md5=info.get("md5"),
inode=info.get("ino"),
mtime=info.get("mtime"),
remote=info.get("remote"),
is_link=info.get("islink", False),
nlink=info.get("nlink", 1),
destination=info.get("destination"),
info["type"] == "directory",
info.get("size"),
None,
is_exec(info.get("mode", 0)),
version_id,
etag,
checksum,
info.get("md5"),
info.get("ino"),
info.get("mtime"),
info.get("remote"),
info.get("islink", False),
info.get("destination"),
info.get("nlink", 1),
)

@classmethod
Expand Down

0 comments on commit 8a9033d

Please sign in to comment.