From cc879a97c3e2614d19b15b4661c3cab4d33139c9 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Thu, 18 Nov 2021 22:40:18 +0000 Subject: Add multi-manifest support with element To be addressed in another change: - a partial `repo sync` (with a list of projects/paths to sync) requires `--this-tree-only`. Change-Id: I6c7400bf001540e9d7694fa70934f8f204cb5f57 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322657 Tested-by: LaMont Jones Reviewed-by: Mike Frysinger --- subcmds/sync.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'subcmds/sync.py') diff --git a/subcmds/sync.py b/subcmds/sync.py index 707c5bbd..f5584dc8 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -66,6 +66,7 @@ _ONE_DAY_S = 24 * 60 * 60 class Sync(Command, MirrorSafeCommand): jobs = 1 COMMON = True + MULTI_MANIFEST_SUPPORT = False helpSummary = "Update working tree to the latest revision" helpUsage = """ %prog [...] @@ -704,7 +705,7 @@ later is required to fix a server side protocol bug. if project.relpath: new_project_paths.append(project.relpath) file_name = 'project.list' - file_path = os.path.join(self.repodir, file_name) + file_path = os.path.join(self.manifest.subdir, file_name) old_project_paths = [] if os.path.exists(file_path): @@ -760,7 +761,7 @@ later is required to fix a server side protocol bug. } copylinkfile_name = 'copy-link-files.json' - copylinkfile_path = os.path.join(self.manifest.repodir, copylinkfile_name) + copylinkfile_path = os.path.join(self.manifest.subdir, copylinkfile_name) old_copylinkfile_paths = {} if os.path.exists(copylinkfile_path): @@ -932,6 +933,9 @@ later is required to fix a server side protocol bug. if opt.prune is None: opt.prune = True + if self.manifest.is_multimanifest and not opt.this_manifest_only and args: + self.OptionParser.error('partial syncs must use --this-manifest-only') + def Execute(self, opt, args): if opt.jobs: self.jobs = opt.jobs -- cgit v1.2.3-54-g00ecf