diff --git a/gclient.py b/gclient.py index a8b1c8730..b19eba090 100755 --- a/gclient.py +++ b/gclient.py @@ -793,13 +793,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): self._postprocess_deps(deps, rel_prefix), self._use_relative_paths) # compute which working directory should be used for hooks - use_relative_hooks = local_scope.get('use_relative_hooks', False) + if local_scope.get('use_relative_hooks', False): + print('use_relative_hooks is deprecated, please remove it from DEPS. ' + + '(it was merged in use_relative_paths)') + hooks_cwd = self.root.root_dir - if use_relative_hooks: - if not self._use_relative_paths: - raise gclient_utils.Error( - 'ParseDepsFile(%s): use_relative_hooks must be used with ' - 'use_relative_paths' % self.name) + if self._use_relative_paths: hooks_cwd = os.path.join(hooks_cwd, self.name) logging.warning('Updating hook base working directory to %s.', hooks_cwd) diff --git a/testing_support/fake_repos.py b/testing_support/fake_repos.py index f1ed360d5..9e4091ae3 100755 --- a/testing_support/fake_repos.py +++ b/testing_support/fake_repos.py @@ -688,7 +688,7 @@ hooks = [{ 'origin': 'git/repo_14@2\n' }) - # A repo with a hook to be recursed in, without use_relative_hooks + # A repo with a hook to be recursed in, without use_relative_paths self._commit_git('repo_15', { 'DEPS': textwrap.dedent("""\ hooks = [{ @@ -698,11 +698,10 @@ hooks = [{ }]"""), 'origin': 'git/repo_15@2\n' }) - # A repo with a hook to be recursed in, with use_relative_hooks + # A repo with a hook to be recursed in, with use_relative_paths self._commit_git('repo_16', { 'DEPS': textwrap.dedent("""\ use_relative_paths=True - use_relative_hooks=True hooks = [{ "name": "relative_cwd", "pattern": ".", diff --git a/tests/gclient_test.py b/tests/gclient_test.py index b8c363831..fcc02ce7e 100755 --- a/tests/gclient_test.py +++ b/tests/gclient_test.py @@ -389,7 +389,7 @@ class GclientTest(trial_dir.TestCase): def testRecurseDepsAndHooksCwd(self): """Verifies that hooks run in the correct directory with our without - use_relative_hooks""" + use_relative_paths""" write( '.gclient', 'solutions = [\n' @@ -417,7 +417,6 @@ class GclientTest(trial_dir.TestCase): write( os.path.join('foo', 'baz', 'DEPS'), 'use_relative_paths=True\n' - 'use_relative_hooks=True\n' 'hooks = [{\n' ' "name": "lazors",\n' ' "pattern": ".",\n'