summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-04-07 16:49:06 +0000
committerLaMont Jones <lamontjones@google.com>2022-04-08 19:52:04 +0000
commita2ff20dd209fe3eb091cdf1bddd4672f86b76bd8 (patch)
treebbddbe26a54504a9cc97d3dd67c7efedcacff2ca /project.py
parent55ee304304a0d83bfa23984c45e46eebdd184124 (diff)
downloadgit-repo-a2ff20dd209fe3eb091cdf1bddd4672f86b76bd8.tar.gz
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 <vapier@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: LaMont Jones <lamontjones@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py27
1 files changed, 14 insertions, 13 deletions
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):
3491 """ 3491 """
3492 assert _kwargs_only == (), 'Sync only accepts keyword arguments.' 3492 assert _kwargs_only == (), 'Sync only accepts keyword arguments.'
3493 3493
3494 groups = groups or 'default'
3495 platform = platform or 'auto'
3494 git_event_log = git_event_log or EventLog() 3496 git_event_log = git_event_log or EventLog()
3495 if outer_manifest and self.manifest.is_submanifest: 3497 if outer_manifest and self.manifest.is_submanifest:
3496 # In a multi-manifest checkout, use the outer manifest unless we are told 3498 # In a multi-manifest checkout, use the outer manifest unless we are told
@@ -3783,19 +3785,18 @@ class ManifestProject(MetaProject):
3783 ) 3785 )
3784 3786
3785 # Lastly, clone the superproject(s). 3787 # Lastly, clone the superproject(s).
3786 if outer_manifest and not self.manifest.is_submanifest: 3788 if self.manifest.manifestProject.use_superproject:
3787 for m in self.manifest.all_manifests: 3789 sync_result = Superproject(
3788 sync_result = Superproject( 3790 self.manifest, self.manifest.repodir, git_event_log, quiet=not verbose).Sync()
3789 m, m.repodir, git_event_log, quiet=not verbose).Sync() 3791 if not sync_result.success:
3790 if not sync_result.success: 3792 print('warning: git update of superproject for '
3791 print(f'warning: git update of superproject for {m.path_prefix} failed, ' 3793 f'{self.manifest.path_prefix} failed, repo sync will not use '
3792 'repo sync will not ' 3794 'superproject to fetch source; while this error is not fatal, '
3793 'use superproject to fetch source; while this error is not fatal, ' 3795 'and you can continue to run repo sync, please run repo init '
3794 'and you can continue to run repo sync, please run repo init with ' 3796 'with the --no-use-superproject option to stop seeing this '
3795 'the --no-use-superproject option to stop seeing this warning', 3797 'warning', file=sys.stderr)
3796 file=sys.stderr) 3798 if sync_result.fatal and use_superproject is not None:
3797 if sync_result.fatal and use_superproject is not None: 3799 return False
3798 return False
3799 3800
3800 return True 3801 return True
3801 3802