diff --git a/gclient.py b/gclient.py index c68e2c39f..f65af57b0 100755 --- a/gclient.py +++ b/gclient.py @@ -796,7 +796,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ]) def findDepsFromNotAllowedHosts(self): - """Returns a list of depenecies from not allowed hosts. + """Returns a list of dependencies from not allowed hosts. If allowed_hosts is not set, allows all hosts and returns empty list. """ diff --git a/tests/gclient_test.py b/tests/gclient_test.py index 227a263e0..ff4c4fa73 100755 --- a/tests/gclient_test.py +++ b/tests/gclient_test.py @@ -772,6 +772,45 @@ class GclientTest(trial_dir.TestCase): ], self._get_processed()) + def testRelativeRecursionInNestedDir(self): + """Verifies a gotcha of relative recursion where the parent uses relative + paths but not the dependency being recursed in. In that case the recursed + dependencies will only take into account the first directory of its path. + In this test it can be seen in baz being placed in foo/third_party.""" + write( + '.gclient', + 'solutions = [\n' + ' { "name": "foo", "url": "svn://example.com/foo" },\n' + ']') + write( + os.path.join('foo', 'DEPS'), + 'use_relative_paths = True\n' + 'deps = {\n' + ' "third_party/bar": "/bar",\n' + '}\n' + 'recursedeps = ["third_party/bar"]') + write( + os.path.join('foo/third_party/bar', 'DEPS'), + 'deps = {\n' + ' "baz": "/baz",\n' + '}') + write( + os.path.join('baz', 'DEPS'), + 'deps = {\n' + ' "fizz": "/fizz",\n' + '}') + + options, _ = gclient.OptionParser().parse_args([]) + obj = gclient.GClient.LoadCurrentConfig(options) + obj.RunOnDeps('None', []) + self.assertEquals( + [ + ('foo', 'svn://example.com/foo'), + ('foo/third_party/bar', 'svn://example.com/bar'), + ('foo/third_party/baz', 'svn://example.com/baz'), + ], + self._get_processed()) + def testRecursedepsAltfile(self): """Verifies gclient respects the |recursedeps| var syntax with overridden target DEPS file.