Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: gclient.py

Issue 8143022: Have the DEPS only parsed in the relevant thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Rebase against 8142030 / 5 Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 6ecb941887330266baf2f15804d9b08b9d7ee484..22e5f990a635b2da696922bf41862c2fa6c1fc6d 100644
--- a/gclient.py
+++ b/gclient.py
@@ -344,22 +344,15 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# It may happen that len(ref) > 1 but it's no big deal.
ref = ref[0]
sub_target = url.sub_target_name or self.name
- # Make sure the referenced dependency DEPS file is loaded and file the
- # inner referenced dependency.
- # TODO(maruel): Shouldn't do that.
- ref.ParseDepsFile()
- found_dep = None
- for d in ref.dependencies:
- if d.name == sub_target:
- found_dep = d
- break
- if not found_dep:
+ found_deps = [d for d in ref.dependencies if d.name == sub_target]
+ if len(found_deps) != 1:
raise gclient_utils.Error(
'Couldn\'t find %s in %s, referenced by %s (parent: %s)\n%s' % (
sub_target, ref.name, self.name, self.parent.name,
str(self.root)))
# Call LateOverride() again.
+ found_dep = found_deps[0]
parsed_url = found_dep.LateOverride(found_dep.url)
logging.info(
'LateOverride(%s, %s) -> %s (From)' % (self.name, url, parsed_url))
@@ -396,9 +389,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
def ParseDepsFile(self):
"""Parses the DEPS file for this dependency."""
- if self.deps_parsed:
- logging.debug('%s was already parsed' % self.name)
- return
+ assert not self.deps_parsed
assert not self.dependencies
# One thing is unintuitive, vars = {} must happen before Var() use.
local_scope = {}
@@ -561,9 +552,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
while file_list[i].startswith(('\\', '/')):
file_list[i] = file_list[i][1:]
- if self.recursion_limit:
- # Then we can parse the DEPS file.
- self.ParseDepsFile()
+ # Always parse the DEPS file.
+ self.ParseDepsFile()
self._run_is_done(file_list, parsed_url)
@@ -685,6 +675,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
@property
@gclient_utils.lockedmethod
def deps_parsed(self):
+ """This is purely for debugging purposes. It's not used anywhere."""
return self._deps_parsed
@property
« no previous file with comments | « no previous file | tests/gclient_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698