summaryrefslogtreecommitdiff
path: root/bin/just-deduplicate-repos.py
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2025-01-09 10:09:56 +0100
committerMaksim Denisov <denisov.maksim@huawei.com>2025-01-09 11:22:18 +0100
commit22ef0a1617fcfaf3e89407b6b9c50b46a04ac8a7 (patch)
treeebb0faf38f31e2e5058cbac04583329dbc50bbdf /bin/just-deduplicate-repos.py
parent8c2b4b603c81d7dc699ff4cbb52787cdfec87b64 (diff)
downloadjustbuild-22ef0a1617fcfaf3e89407b6b9c50b46a04ac8a7.tar.gz
Support deduplication of "tree structure" roots
Diffstat (limited to 'bin/just-deduplicate-repos.py')
-rwxr-xr-xbin/just-deduplicate-repos.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/just-deduplicate-repos.py b/bin/just-deduplicate-repos.py
index 25186b08..9b3f9407 100755
--- a/bin/just-deduplicate-repos.py
+++ b/bin/just-deduplicate-repos.py
@@ -69,10 +69,11 @@ def bisimilar_repos(repos: Json) -> List[List[str]]:
elif a["type"] == "git":
return (a["commit"] == b["commit"]
and a.get("subdir", ".") == b.get("subdir", "."))
- elif a["type"] == "computed":
- if (a.get("config", {}) != b.get("config", {})
- or a["target"] != b["target"]):
- return False
+ elif a["type"] in ["computed", "tree structure"]:
+ if a["type"] == "computed":
+ if (a.get("config", {}) != b.get("config", {})
+ or a["target"] != b["target"]):
+ return False
if a["repo"] == b["repo"]:
return True
elif is_different(a["repo"], b["repo"]):
@@ -280,7 +281,7 @@ def dedup(repos: Json, user_keep: List[str]) -> Json:
# Update target repos of precomputed roots:
if isinstance(desc.get("repository"), dict):
repo_root: Json = desc.get("repository")
- if repo_root["type"] == "computed" and \
+ if repo_root["type"] in ["computed", "tree structure"] and \
repo_root["repo"] in renaming:
repo_root = \
dict(repo_root, **{"repo": renaming[repo_root["repo"]]})