manifest: Propagate revision attribute through multiple levels of include

Make sure a revision attribute for an include element is propagated
through multiple levels of manifest includes.

Change-Id: If37d65b0cd47da673719976598175d0eb6b7cbbe
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525341
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Peter Kjellerstedt
2025-11-08 06:42:53 +01:00
committed by LUCI
parent 75773b8b9d
commit 3073a90046
4 changed files with 40 additions and 10 deletions
+8 -8
View File
@@ -1305,6 +1305,14 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
nodes = []
for node in manifest.childNodes:
if (
parent_node
and node.nodeName in ("include", "project")
and not node.hasAttribute("revision")
):
node.setAttribute(
"revision", parent_node.getAttribute("revision")
)
if node.nodeName == "include":
name = self._reqatt(node, "name")
if restrict_includes:
@@ -1349,14 +1357,6 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
node.getAttribute("groups")
)
node.setAttribute("groups", ",".join(sorted(nodeGroups)))
if (
parent_node
and node.nodeName == "project"
and not node.hasAttribute("revision")
):
node.setAttribute(
"revision", parent_node.getAttribute("revision")
)
nodes.append(node)
return nodes