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

Unified Diff: gclient.py

Issue 11146032: Add recursion=n syntax to DEPS files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 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 | no next file » | 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 9065952bdfd959d56b56dbdf1be77ebfc3dd1c61..513d6376421cfa7eeb6c66f1d6e2a6191acfbbb5 100644
--- a/gclient.py
+++ b/gclient.py
@@ -168,6 +168,10 @@ class DependencySettings(GClientKeywords):
# recursion limit and controls gclient's behavior so it does not misbehave.
self._managed = managed
self._should_process = should_process
+ # This is a mutable value that overrides the normal recursion limit for this
+ # dependency. It is read from the actual DEPS file so cannot be set on
+ # class instantiation.
+ self.recursion_override = None
M-A Ruel 2012/10/16 14:15:00 Make it protected.
Isaac (away) 2012/10/17 08:19:05 I set this in a different class.
# These are only set in .gclient and not in DEPS files.
self._custom_vars = custom_vars or {}
@@ -231,7 +235,7 @@ class DependencySettings(GClientKeywords):
@property
def recursion_limit(self):
"""Returns > 0 if this dependency is not too recursed to be processed."""
- return max(self.parent.recursion_limit - 1, 0)
+ return self.recursion_override or max(self.parent.recursion_limit - 1, 0)
M-A Ruel 2012/10/16 14:15:00 It could be 0, which would be valid, so check if t
Isaac (away) 2012/10/17 08:19:05 Done.
def get_custom_deps(self, name, url):
"""Returns a custom deps if applicable."""
@@ -445,6 +449,10 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
except SyntaxError, e:
gclient_utils.SyntaxErrorToError(filepath, e)
deps = local_scope.get('deps', {})
+ if 'recursion' in local_scope:
+ self.recursion_override = local_scope['recursion']
M-A Ruel 2012/10/16 14:15:00 local_scope.get('recursion')
Isaac (away) 2012/10/17 08:19:05 Done.
+ logging.warning(
+ 'Setting %s recursion to %d.', self.name, self.recursion_limit)
# load os specific dependencies if defined. these dependencies may
# override or extend the values defined by the 'deps' member.
if 'deps_os' in local_scope:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698