Skip to content

Commit 53e9ad6

Browse files
committed
unprotect: add progress bar
1 parent 7c898cf commit 53e9ad6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dvc/output.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,10 @@ def get_files_number(self, filter_info=None):
10921092

10931093
def unprotect(self):
10941094
if self.exists and self.use_cache:
1095-
self.cache.unprotect(self.fs_path)
1095+
with Callback.as_tqdm_callback(
1096+
size=self.meta.nfiles or -1, desc=f"Unprotecting {self}"
1097+
) as callback:
1098+
self.cache.unprotect(self.fs_path, callback=callback)
10961099

10971100
def get_dir_cache(self, **kwargs) -> Optional["Tree"]:
10981101
if not self.is_dir_checksum:

dvc/repo/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,10 @@ def init(root_dir=os.curdir, no_scm=False, force=False, subdir=False) -> "Repo":
447447
return init(root_dir=root_dir, no_scm=no_scm, force=force, subdir=subdir)
448448

449449
def unprotect(self, target):
450-
return self.cache.repo.unprotect(target)
450+
from dvc_objects.fs.callbacks import Callback
451+
452+
with Callback.as_tqdm_callback(desc=f"Unprotecting {target}") as callback:
453+
return self.cache.repo.unprotect(target, callback=callback)
451454

452455
def _ignore(self):
453456
flist = [self.config.files["local"]]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dependencies = [
3535
"configobj>=5.0.6",
3636
"distro>=1.3",
3737
"dpath<3,>=2.1.0",
38-
"dvc-data>=2.22.6,<2.23.0",
38+
"dvc-data>=2.23,<2.24",
3939
"dvc-http>=2.29.0",
4040
"dvc-render>=1.0.0,<2",
4141
"dvc-studio-client>=0.17.1,<1",

0 commit comments

Comments
 (0)