diff options
author | LaMont Jones <lamontjones@google.com> | 2022-02-25 17:05:21 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-02-28 20:08:58 +0000 |
commit | b308db1e2a982ae4158cb6fedd23d3d547bd09b0 (patch) | |
tree | 01cf56da1875f742489499096430b7b2f45cc3b1 | |
parent | cc879a97c3e2614d19b15b4661c3cab4d33139c9 (diff) | |
download | git-repo-b308db1e2a982ae4158cb6fedd23d3d547bd09b0.tar.gz |
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>
-rw-r--r-- | docs/manifest-format.md | 3 | ||||
-rw-r--r-- | manifest_xml.py | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/docs/manifest-format.md b/docs/manifest-format.md index 7c0a7da9..6e671080 100644 --- a/docs/manifest-format.md +++ b/docs/manifest-format.md | |||
@@ -281,6 +281,9 @@ with the new settings needed. | |||
281 | If not supplied the remote and project for this manifest will be used: `remote` | 281 | If not supplied the remote and project for this manifest will be used: `remote` |
282 | cannot be supplied. | 282 | cannot be supplied. |
283 | 283 | ||
284 | Projects from a submanifest and its submanifests are added to the | ||
285 | submanifest::path:<path_prefix> group. | ||
286 | |||
284 | Attribute `manifest-name`: The manifest filename in the manifest project. If | 287 | Attribute `manifest-name`: The manifest filename in the manifest project. If |
285 | not supplied, `default.xml` is used. | 288 | not supplied, `default.xml` is used. |
286 | 289 | ||
diff --git a/manifest_xml.py b/manifest_xml.py index 7a4eb1e8..fa3e1034 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -36,6 +36,8 @@ LOCAL_MANIFESTS_DIR_NAME = 'local_manifests' | |||
36 | SUBMANIFEST_DIR = 'submanifests' | 36 | SUBMANIFEST_DIR = 'submanifests' |
37 | # Limit submanifests to an arbitrary depth for loop detection. | 37 | # Limit submanifests to an arbitrary depth for loop detection. |
38 | MAX_SUBMANIFEST_DEPTH = 8 | 38 | MAX_SUBMANIFEST_DEPTH = 8 |
39 | # Add all projects from sub manifest into a group. | ||
40 | SUBMANIFEST_GROUP_PREFIX = 'submanifest:' | ||
39 | 41 | ||
40 | # Add all projects from local manifest into a group. | 42 | # Add all projects from local manifest into a group. |
41 | LOCAL_MANIFEST_GROUP_PREFIX = 'local:' | 43 | LOCAL_MANIFEST_GROUP_PREFIX = 'local:' |
@@ -990,6 +992,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
990 | self.branch = b | 992 | self.branch = b |
991 | 993 | ||
992 | parent_groups = self.parent_groups | 994 | parent_groups = self.parent_groups |
995 | if self.path_prefix: | ||
996 | parent_groups = f'{SUBMANIFEST_GROUP_PREFIX}:path:{self.path_prefix},{parent_groups}' | ||
993 | 997 | ||
994 | # The manifestFile was specified by the user which is why we allow include | 998 | # The manifestFile was specified by the user which is why we allow include |
995 | # paths to point anywhere. | 999 | # paths to point anywhere. |