Index: gclient.py |
diff --git a/gclient.py b/gclient.py |
index 9065952bdfd959d56b56dbdf1be77ebfc3dd1c61..7d282f2ca266e4d93c574cbef50e3e1cf3463889 100644 |
--- a/gclient.py |
+++ b/gclient.py |
@@ -168,6 +168,14 @@ 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. |
+ # This is currently only supported for top-level deps because gclient does |
M-A Ruel
2012/10/17 11:08:25
Interesting note. I would have said it's just fine
Isaac (away)
2012/10/17 16:24:02
Here's an example of what I'm concerned about. Ma
M-A Ruel
2012/10/17 16:57:34
I'm pretty sure it's handled correctly. "deps3" is
|
+ # not have logic for conflict handling where the same dep is specified |
+ # twice, one in a non-overriden subtree and one in an overriden subtree. |
+ # TODO(ilevy) Add recursion override support for non-top-level deps. |
+ self.recursion_override = None |
# These are only set in .gclient and not in DEPS files. |
self._custom_vars = custom_vars or {} |
@@ -231,6 +239,8 @@ class DependencySettings(GClientKeywords): |
@property |
def recursion_limit(self): |
"""Returns > 0 if this dependency is not too recursed to be processed.""" |
+ if self.recursion_override is not None: |
+ return self.recursion_override |
return max(self.parent.recursion_limit - 1, 0) |
def get_custom_deps(self, name, url): |
@@ -445,6 +455,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: |
M-A Ruel
2012/10/17 11:08:25
No need to "if" that. local_scope.get('recursion')
Isaac (away)
2012/10/17 16:24:02
I want the if for the logging line, though.
|
+ self.recursion_override = local_scope.get('recursion') |
+ 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: |