manifest_xml: group for submanifest projects

Add all projects in a submanifest to the group
submanifest::<path_prefix> for ease in filtering.

Change-Id: Ia6f01f9445f4f8d20fda3402f4d5821c43ceaf7f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/331319
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
LaMont Jones 2022-02-25 17:05:21 +00:00
parent cc879a97c3
commit b308db1e2a
2 changed files with 7 additions and 0 deletions

View File

@ -281,6 +281,9 @@ with the new settings needed.
If not supplied the remote and project for this manifest will be used: `remote` If not supplied the remote and project for this manifest will be used: `remote`
cannot be supplied. cannot be supplied.
Projects from a submanifest and its submanifests are added to the
submanifest::path:<path_prefix> group.
Attribute `manifest-name`: The manifest filename in the manifest project. If Attribute `manifest-name`: The manifest filename in the manifest project. If
not supplied, `default.xml` is used. not supplied, `default.xml` is used.

View File

@ -36,6 +36,8 @@ LOCAL_MANIFESTS_DIR_NAME = 'local_manifests'
SUBMANIFEST_DIR = 'submanifests' SUBMANIFEST_DIR = 'submanifests'
# Limit submanifests to an arbitrary depth for loop detection. # Limit submanifests to an arbitrary depth for loop detection.
MAX_SUBMANIFEST_DEPTH = 8 MAX_SUBMANIFEST_DEPTH = 8
# Add all projects from sub manifest into a group.
SUBMANIFEST_GROUP_PREFIX = 'submanifest:'
# Add all projects from local manifest into a group. # Add all projects from local manifest into a group.
LOCAL_MANIFEST_GROUP_PREFIX = 'local:' LOCAL_MANIFEST_GROUP_PREFIX = 'local:'
@ -990,6 +992,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md
self.branch = b self.branch = b
parent_groups = self.parent_groups parent_groups = self.parent_groups
if self.path_prefix:
parent_groups = f'{SUBMANIFEST_GROUP_PREFIX}:path:{self.path_prefix},{parent_groups}'
# The manifestFile was specified by the user which is why we allow include # The manifestFile was specified by the user which is why we allow include
# paths to point anywhere. # paths to point anywhere.