Commit da3a29e1 authored by Dirk Pranke's avatar Dirk Pranke Committed by Commit Bot

Do not run unconditionally run pre_deps_hooks for dependencies.

Currently if you set `pre_deps_hooks` in your gclient DEPS file,
they will be executed regardless of whether your repo was supposed
to be recursed into (via recursionlimit or recursedeps) or not.

This change fixes that so that we only run the hooks that were
explicitly configured to be run.

R=kjellander@chromium.org, agable@chromium.org
BUG=696495

Change-Id: Ic0ef641903cf3f56d7c2e119d8b0db862258d995
Reviewed-on: https://chromium-review.googlesource.com/447318Reviewed-by: 's avatarAaron Gable <agable@chromium.org>
Reviewed-by: 's avatarHenrik Kjellander <kjellander@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
parent e2a4fd22
......@@ -714,8 +714,9 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
if 'action' in hook:
hooks_to_run.append(hook)
self._pre_deps_hooks = [self.GetHookAction(hook, []) for hook in
local_scope.get('pre_deps_hooks', [])]
if self.recursion_limit:
self._pre_deps_hooks = [self.GetHookAction(hook, []) for hook in
local_scope.get('pre_deps_hooks', [])]
self.add_dependencies_and_close(deps_to_add, hooks_to_run)
logging.info('ParseDepsFile(%s) done' % self.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment