Use only DEPS git depedencies if SYNC is used

If git submodules and DEPS ever go out of sync, there are two different
behaviors in gclient:
* gclient gitmodules needs to read DEPS file and generate submodules
* all other gclient operations prefer content of git submodules.

Since we enforce SYNC to always match their content via presubmit
checks, it's reasonable to expect they will only diverge on development
environment. User is more likely to update DEPS file by hand than to
gitlink.

If user updates a gitlink accidentally, gclient sync won't checkout to
content of DEPS which then will require user to take additional steps to
recover.

This change uses DEPS to be source of truth for git dependencies if
git_dependencies == SYNC.

R=aravindvasudev@google.com, jojwang@google.com

Bug: 1476108
Change-Id: I5b22095b5c9ec764ea6bf07310a0e5bba4a71aad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4820459
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
changes/59/4820459/2
Josip Sokcevic 2 years ago committed by LUCI CQ
parent 6c8d2a9ce5
commit e40f71cbde

@ -861,8 +861,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
deps = local_scope.get('deps', {})
# If dependencies are configured within git submodules, add them to deps.
if self.git_dependencies_state in (gclient_eval.SUBMODULES,
gclient_eval.SYNC):
# We don't add for SYNC since we expect submodules to be in sync.
if self.git_dependencies_state == gclient_eval.SUBMODULES:
deps.update(self.ParseGitSubmodules())
deps_to_add = self._deps_to_objects(

Loading…
Cancel
Save