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/447318
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Henrik Kjellander <kjellander@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
changes/18/447318/2
Dirk Pranke 8 years ago committed by Commit Bot
parent e2a4fd22ac
commit da3a29e13e

@ -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)

Loading…
Cancel
Save