From feb28914bd17aacc2d251516e504a33f991f86c4 Mon Sep 17 00:00:00 2001 From: Raman Tenneti Date: Sun, 2 May 2021 19:47:29 -0700 Subject: superproject: Don't update the commit ids of projects if remote is different. 1) Skip setting the revision id (commit id) for the projects whose remote doesn't match superproject's remote. 2) exp-superproject/superproject_override.xml includes local_manfiest's projects. When we load this XML, don't reload projects from local.xml (otherwise we will get duplicate projects errors). Tested the code with the following commands. $ ./run_tests -v + Test with local.xml $ repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b master --use-superproject --partial-clone --clone-filter=blob:limit=10M && mkdir -p .repo/local_manifests && (gcertstatus -quiet=true || gcert) && ln -s /google/src/head/depot/google3/wireless/android/build_tools/aosp/manifests/mirror-aosp-master-with-vendor/local.xml .repo/local_manifests/local.xml $ repo_dev sync -c -j8 + Test without local.xml $ repo_dev init -u sso://android.git.corp.google.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M --repo-rev=main --use-superproject $ repo_dev sync -c -j8 Bug: [google internal] b/186395810 Change-Id: I4e9d4ac2d94a9fc0cef0ccd787b6310758009e86 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304882 Tested-by: Raman Tenneti Reviewed-by: Mike Frysinger --- manifest_xml.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifest_xml.py') diff --git a/manifest_xml.py b/manifest_xml.py index 64b7fb4e..73556a5e 100644 --- a/manifest_xml.py +++ b/manifest_xml.py @@ -595,6 +595,10 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md 'repo.partialcloneexclude') or '' return set(x.strip() for x in exclude.split(',')) + @property + def HasLocalManifests(self): + return self._load_local_manifests and self.local_manifests + @property def IsMirror(self): return self.manifestProject.config.GetBoolean('repo.mirror') -- cgit v1.2.3-54-g00ecf