summaryrefslogtreecommitdiffstats
path: root/git_superproject.py
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-05-02 19:47:29 -0700
committerRaman Tenneti <rtenneti@google.com>2021-05-03 05:13:23 +0000
commitfeb28914bd17aacc2d251516e504a33f991f86c4 (patch)
tree66865f9cb25d6134acb02e63502636c366a963cd /git_superproject.py
parentd1f3e149df4482ee24feee038c88df32fbc77380 (diff)
downloadgit-repo-feb28914bd17aacc2d251516e504a33f991f86c4.tar.gz
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 <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r--git_superproject.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/git_superproject.py b/git_superproject.py
index 2516545d..031f45c9 100644
--- a/git_superproject.py
+++ b/git_superproject.py
@@ -262,10 +262,20 @@ class Superproject(object):
262 return None 262 return None
263 263
264 projects_missing_commit_ids = [] 264 projects_missing_commit_ids = []
265 superproject_remote_name = self._manifest.superproject['remote'].name
265 for project in projects: 266 for project in projects:
266 path = project.relpath 267 path = project.relpath
267 if not path: 268 if not path:
268 continue 269 continue
270 # Some manifests that pull projects from the "chromium" GoB
271 # (remote="chromium"), and have a private manifest that pulls projects
272 # from both the chromium GoB and "chrome-internal" GoB (remote="chrome").
273 # For such projects, one of the remotes will be different from
274 # superproject's remote. Until superproject, supports multiple remotes,
275 # don't update the commit ids of remotes that don't match superproject's
276 # remote.
277 if project.remote.name != superproject_remote_name:
278 continue
269 commit_id = commit_ids.get(path) 279 commit_id = commit_ids.get(path)
270 if commit_id: 280 if commit_id:
271 project.SetRevisionId(commit_id) 281 project.SetRevisionId(commit_id)