Procházet zdrojové kódy

Revert "Remove use_relative_hooks now that all deprecated uses are removed."

This reverts commit 4de6cfa5a9368a4a10937e6527e55bc993113858.

Reason for revert: Breaks syncing old versions.

Original change's description:
> Remove use_relative_hooks now that all deprecated uses are removed.
> 
> Bug: chromium:1107325
> Change-Id: Iac1ff8ef9426c8f57b6e12783de0ffbb0625ef2b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2349170
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,ehmaldonado@chromium.org,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com

Change-Id: I91229c64486fe328341d1951a0b8d4dc33ee8810
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1107325
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2352090
Auto-Submit: Michael Spang <spang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Michael Spang před 5 roky
rodič
revize
0e99b9be0a
2 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 4 0
      gclient.py
  2. 4 0
      gclient_eval.py

+ 4 - 0
gclient.py

@@ -793,6 +793,10 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
         self._postprocess_deps(deps, rel_prefix), self._use_relative_paths)
         self._postprocess_deps(deps, rel_prefix), self._use_relative_paths)
 
 
     # compute which working directory should be used for hooks
     # compute which working directory should be used for hooks
+    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)', file=sys.stderr)
+
     hooks_cwd = self.root.root_dir
     hooks_cwd = self.root.root_dir
     if self._use_relative_paths:
     if self._use_relative_paths:
       hooks_cwd = os.path.join(hooks_cwd, self.name)
       hooks_cwd = os.path.join(hooks_cwd, self.name)

+ 4 - 0
gclient_eval.py

@@ -235,6 +235,10 @@ _GCLIENT_SCHEMA = schema.Schema(
         # file.
         # file.
         schema.Optional('use_relative_paths'): bool,
         schema.Optional('use_relative_paths'): bool,
 
 
+        # For recursed-upon sub-dependencies, run their hooks relative to the
+        # parent's path instead of relative to the .gclient file.
+        schema.Optional('use_relative_hooks'): bool,
+
         # Variables that can be referenced using Var() - see 'deps'.
         # Variables that can be referenced using Var() - see 'deps'.
         schema.Optional('vars'): _NodeDictSchema({
         schema.Optional('vars'): _NodeDictSchema({
             schema.Optional(basestring): schema.Or(ConstantString,
             schema.Optional(basestring): schema.Or(ConstantString,