From 501733c2abb1180679f25b2f78970d73a2f8d413 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Wed, 20 Apr 2022 16:42:32 +0000 Subject: [PATCH] manifest: add submanifest.default_groups attribute When the user does not specify any manifest groups, this allows the parent manifest to indicate which manifest groups should be used for syncing the submanifest. Change-Id: I88806ed35013d13dd2ab3cd245fcd4f9061112c4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/335474 Tested-by: LaMont Jones Reviewed-by: Mike Frysinger --- docs/manifest-format.md | 4 ++++ manifest_xml.py | 41 +++++++++++++++++++++++++++++++---------- project.py | 5 +++-- subcmds/info.py | 3 +-- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/docs/manifest-format.md b/docs/manifest-format.md index 6e67108..0d26296 100644 --- a/docs/manifest-format.md +++ b/docs/manifest-format.md @@ -66,6 +66,7 @@ following DTD: + invalid "path": %s: %s' % (path, msg)) submanifest = _XmlSubmanifest(name, remote, project, revision, manifestName, - groups, path, self) + groups, default_groups, path, self) for n in node.childNodes: if n.nodeName == 'annotation': diff --git a/project.py b/project.py index 7afd6a7..2641c44 100644 --- a/project.py +++ b/project.py @@ -715,7 +715,8 @@ class Project(object): The special manifest group "default" will match any project that does not have the special project group "notdefault" """ - expanded_manifest_groups = manifest_groups or ['default'] + default_groups = self.manifest.default_groups or ['default'] + expanded_manifest_groups = manifest_groups or default_groups expanded_project_groups = ['all'] + (self.groups or []) if 'notdefault' not in expanded_project_groups: expanded_project_groups += ['default'] @@ -3496,7 +3497,7 @@ class ManifestProject(MetaProject): """ assert _kwargs_only == (), 'Sync only accepts keyword arguments.' - groups = groups or 'default' + groups = groups or self.manifest.GetDefaultGroupsStr(with_platform=False) platform = platform or 'auto' git_event_log = git_event_log or EventLog() if outer_manifest and self.manifest.is_submanifest: diff --git a/subcmds/info.py b/subcmds/info.py index 4bedf9d..baa4c5b 100644 --- a/subcmds/info.py +++ b/subcmds/info.py @@ -65,8 +65,7 @@ class Info(PagedCommand): self.manifest = self.manifest.outer_client manifestConfig = self.manifest.manifestProject.config mergeBranch = manifestConfig.GetBranch("default").merge - manifestGroups = (manifestConfig.GetString('manifest.groups') - or 'all,-notdefault') + manifestGroups = self.manifest.GetGroupsStr() self.heading("Manifest branch: ") if self.manifest.default.revisionExpr: