output: add progress for commit

This commit is contained in:
Peter Rowlands
2023-08-03 18:19:19 +09:00
committed by Peter Rowlands (변기호)
parent d01e2355d4
commit 761422638f
+22 -1
View File
@@ -787,12 +787,17 @@ class Output:
self.hash_name,
ignore=self.dvcignore,
)
with Callback.as_tqdm_callback(
desc=f"Committing {self} to cache",
unit="file",
) as cb:
otransfer(
staging,
self.cache,
{obj.hash_info},
shallow=False,
hardlink=hardlink,
callback=cb,
)
if relink:
rel = self.fs.path.relpath(filter_info or self.fs_path)
@@ -822,12 +827,17 @@ class Output:
save_obj = obj.filter(prefix)
assert isinstance(save_obj, Tree)
checkout_obj = save_obj.get_obj(self.cache, prefix)
with Callback.as_tqdm_callback(
desc=f"Committing {self} to cache",
unit="file",
) as cb:
otransfer(
staging,
self.cache,
{save_obj.hash_info} | {oid for _, _, oid in save_obj},
shallow=True,
hardlink=hardlink,
callback=cb,
)
return checkout_obj
@@ -1423,7 +1433,18 @@ class Output:
assert staging
assert obj.hash_info
otransfer(staging, self.cache, {obj.hash_info}, hardlink=relink, shallow=False)
with Callback.as_tqdm_callback(
desc=f"Adding {self} to cache",
unit="file",
) as cb:
otransfer(
staging,
self.cache,
{obj.hash_info},
hardlink=relink,
shallow=False,
callback=cb,
)
if relink:
with CheckoutCallback(