From a2ff20dd209fe3eb091cdf1bddd4672f86b76bd8 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 7 Apr 2022 16:49:06 +0000 Subject: manifest_xml: Add Load and Unload methods - do not call the internal method from subcmds/sync.py. - use the correct default groups for submanifests. - only sync the superproject when we are told to. Change-Id: I81e4025058f1ee564732b9e17aecc522f6b5f626 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334639 Reviewed-by: Mike Frysinger Reviewed-by: Raman Tenneti Tested-by: LaMont Jones --- project.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index a60a8582..b8d834aa 100644 --- a/project.py +++ b/project.py @@ -3491,6 +3491,8 @@ class ManifestProject(MetaProject): """ assert _kwargs_only == (), 'Sync only accepts keyword arguments.' + groups = groups or 'default' + platform = platform or 'auto' git_event_log = git_event_log or EventLog() if outer_manifest and self.manifest.is_submanifest: # In a multi-manifest checkout, use the outer manifest unless we are told @@ -3783,19 +3785,18 @@ class ManifestProject(MetaProject): ) # Lastly, clone the superproject(s). - if outer_manifest and not self.manifest.is_submanifest: - for m in self.manifest.all_manifests: - sync_result = Superproject( - m, m.repodir, git_event_log, quiet=not verbose).Sync() - if not sync_result.success: - print(f'warning: git update of superproject for {m.path_prefix} failed, ' - 'repo sync will not ' - 'use superproject to fetch source; while this error is not fatal, ' - 'and you can continue to run repo sync, please run repo init with ' - 'the --no-use-superproject option to stop seeing this warning', - file=sys.stderr) - if sync_result.fatal and use_superproject is not None: - return False + if self.manifest.manifestProject.use_superproject: + sync_result = Superproject( + self.manifest, self.manifest.repodir, git_event_log, quiet=not verbose).Sync() + if not sync_result.success: + print('warning: git update of superproject for ' + f'{self.manifest.path_prefix} failed, repo sync will not use ' + 'superproject to fetch source; while this error is not fatal, ' + 'and you can continue to run repo sync, please run repo init ' + 'with the --no-use-superproject option to stop seeing this ' + 'warning', file=sys.stderr) + if sync_result.fatal and use_superproject is not None: + return False return True -- cgit v1.2.3-54-g00ecf