diff options
author | LaMont Jones <lamontjones@google.com> | 2021-11-18 22:40:18 +0000 |
---|---|---|
committer | LaMont Jones <lamontjones@google.com> | 2022-02-17 21:57:55 +0000 |
commit | cc879a97c3e2614d19b15b4661c3cab4d33139c9 (patch) | |
tree | 69d225e9f0e9d79fec8f423d9c40c275f0bf3b8c /subcmds/sync.py | |
parent | 87cce68b28c34fa86895baa8d7f48307382e6c75 (diff) | |
download | git-repo-cc879a97c3e2614d19b15b4661c3cab4d33139c9.tar.gz |
Add multi-manifest support with <submanifest> elementv2.22
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 <lamontjones@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 | |||
66 | class Sync(Command, MirrorSafeCommand): | 66 | class Sync(Command, MirrorSafeCommand): |
67 | jobs = 1 | 67 | jobs = 1 |
68 | COMMON = True | 68 | COMMON = True |
69 | MULTI_MANIFEST_SUPPORT = False | ||
69 | helpSummary = "Update working tree to the latest revision" | 70 | helpSummary = "Update working tree to the latest revision" |
70 | helpUsage = """ | 71 | helpUsage = """ |
71 | %prog [<project>...] | 72 | %prog [<project>...] |
@@ -704,7 +705,7 @@ later is required to fix a server side protocol bug. | |||
704 | if project.relpath: | 705 | if project.relpath: |
705 | new_project_paths.append(project.relpath) | 706 | new_project_paths.append(project.relpath) |
706 | file_name = 'project.list' | 707 | file_name = 'project.list' |
707 | file_path = os.path.join(self.repodir, file_name) | 708 | file_path = os.path.join(self.manifest.subdir, file_name) |
708 | old_project_paths = [] | 709 | old_project_paths = [] |
709 | 710 | ||
710 | if os.path.exists(file_path): | 711 | if os.path.exists(file_path): |
@@ -760,7 +761,7 @@ later is required to fix a server side protocol bug. | |||
760 | } | 761 | } |
761 | 762 | ||
762 | copylinkfile_name = 'copy-link-files.json' | 763 | copylinkfile_name = 'copy-link-files.json' |
763 | copylinkfile_path = os.path.join(self.manifest.repodir, copylinkfile_name) | 764 | copylinkfile_path = os.path.join(self.manifest.subdir, copylinkfile_name) |
764 | old_copylinkfile_paths = {} | 765 | old_copylinkfile_paths = {} |
765 | 766 | ||
766 | if os.path.exists(copylinkfile_path): | 767 | if os.path.exists(copylinkfile_path): |
@@ -932,6 +933,9 @@ later is required to fix a server side protocol bug. | |||
932 | if opt.prune is None: | 933 | if opt.prune is None: |
933 | opt.prune = True | 934 | opt.prune = True |
934 | 935 | ||
936 | if self.manifest.is_multimanifest and not opt.this_manifest_only and args: | ||
937 | self.OptionParser.error('partial syncs must use --this-manifest-only') | ||
938 | |||
935 | def Execute(self, opt, args): | 939 | def Execute(self, opt, args): |
936 | if opt.jobs: | 940 | if opt.jobs: |
937 | self.jobs = opt.jobs | 941 | self.jobs = opt.jobs |