We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d440a37 commit 6301414Copy full SHA for 6301414
src/dvc_data/hashfile/gc.py
@@ -1,12 +1,15 @@
1
+import logging
2
from collections.abc import Iterable
3
from typing import TYPE_CHECKING, Optional
4
5
if TYPE_CHECKING:
6
from .db import HashFileDB
7
from .hash_info import HashInfo
8
9
+logger = logging.getLogger(__name__)
10
-def gc( # noqa: C901
11
+
12
+def gc( # noqa: C901, PLR0912
13
odb: "HashFileDB",
14
used: Iterable["HashInfo"],
15
jobs: Optional[int] = None,
@@ -55,7 +58,10 @@ def _is_dir_hash(_hash):
55
58
for paths in (dir_paths, file_paths):
56
59
if paths:
57
60
num_removed += len(paths)
- if not dry:
61
+ if dry:
62
+ for path in paths:
63
+ logger.info("Removing %s", path)
64
+ else:
65
odb.fs.remove(paths)
66
67
return num_removed
0 commit comments