MCPcopy
hub / github.com/treeverse/dvc / _commit_granular_dir

Method _commit_granular_dir

dvc/output.py:802–820  ·  view source on GitHub ↗
(self, filter_info, hardlink)

Source from the content-addressed store, hash-verified

800 self.set_exec()
801
802 def _commit_granular_dir(self, filter_info, hardlink) -> Optional["HashFile"]:
803 prefix = self.fs.parts(self.fs.relpath(filter_info, self.fs_path))
804 staging, _, obj = self._build(
805 self.cache, self.fs_path, self.fs, self.hash_name, ignore=self.dvcignore
806 )
807 assert isinstance(obj, Tree)
808 save_obj = obj.filter(prefix)
809 assert isinstance(save_obj, Tree)
810 checkout_obj = save_obj.get_obj(self.cache, prefix)
811 with TqdmCallback(desc=f"Committing {self} to cache", unit="file") as cb:
812 otransfer(
813 staging,
814 self.cache,
815 {save_obj.hash_info} | {oid for _, _, oid in save_obj},
816 shallow=True,
817 hardlink=hardlink,
818 callback=cb,
819 )
820 return checkout_obj
821
822 def dumpd(self, **kwargs): # noqa: C901, PLR0912
823 from dvc.cachemgr import LEGACY_HASH_NAMES

Callers 1

commitMethod · 0.95

Calls 5

_buildMethod · 0.95
TqdmCallbackClass · 0.85
get_objMethod · 0.80
partsMethod · 0.45
relpathMethod · 0.45

Tested by

no test coverage detected