Remove all nodes for repo_tag from the global graph. Returns count removed.
(repo_tag: str)
| 157 | |
| 158 | |
| 159 | def global_remove(repo_tag: str) -> int: |
| 160 | """Remove all nodes for repo_tag from the global graph. Returns count removed.""" |
| 161 | from graphify.build import prune_repo_from_graph |
| 162 | |
| 163 | manifest = _load_manifest() |
| 164 | if repo_tag not in manifest["repos"]: |
| 165 | raise KeyError(f"repo '{repo_tag}' not in global graph") |
| 166 | |
| 167 | G = _load_global_graph() |
| 168 | removed = prune_repo_from_graph(G, repo_tag) |
| 169 | _save_global_graph(G) |
| 170 | |
| 171 | del manifest["repos"][repo_tag] |
| 172 | _save_manifest(manifest) |
| 173 | return removed |
| 174 | |
| 175 | |
| 176 | def global_list() -> dict: |