From 6c484875cdcbfeba43a4fae0106a1be8ca65eff1 Mon Sep 17 00:00:00 2001 From: Garrett Beaty Date: Fri, 28 Aug 2020 19:31:26 +0000 Subject: [PATCH] Ensure all keys in the bot_update revisions dict use forward slash. On Windows, the path that gets computed from the gitiles commit uses backslashes, which won't match the format of the paths that bot_update.py uses. Bug: 1047893 Change-Id: Ie1f6c070558fe00d6f4b1f2fd453e430b21a55ed Recipe-Nontrivial-Roll: build_limited_scripts_slave Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2380590 Commit-Queue: Garrett Beaty Reviewed-by: Josip Sokcevic --- recipes/README.recipes.md | 6 +++--- recipes/recipe_modules/bot_update/api.py | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/recipes/README.recipes.md b/recipes/README.recipes.md index dcb510c43..c64daced1 100644 --- a/recipes/README.recipes.md +++ b/recipes/README.recipes.md @@ -58,7 +58,7 @@ Recipe module to ensure a checkout is consistent on a bot. Wrapper for easy calling of bot_update. -— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#515)(self, bot_update_step):** +— **def [deapply\_patch](/recipes/recipe_modules/bot_update/api.py#518)(self, bot_update_step):** Deapplies a patch, taking care of DEPS and solution revisions properly. @@ -89,7 +89,7 @@ Args: step_test_data: a null function that returns test bot_update.py output. Use test_api.output_json to generate test data. -— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#492)(self, project_name, gclient_config=None):** +— **def [get\_project\_revision\_properties](/recipes/recipe_modules/bot_update/api.py#495)(self, project_name, gclient_config=None):** Returns all property names used for storing the checked-out revision of a given project. @@ -107,7 +107,7 @@ Returns (list of str): All properties that'll hold the checked-out revision   **@property**
— **def [last\_returned\_properties](/recipes/recipe_modules/bot_update/api.py#44)(self):** -— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#442)(self, bot_update_json, name):** +— **def [resolve\_fixed\_revision](/recipes/recipe_modules/bot_update/api.py#445)(self, bot_update_json, name):** Set a fixed revision for a single dependency using project revision properties. diff --git a/recipes/recipe_modules/bot_update/api.py b/recipes/recipe_modules/bot_update/api.py index e30d10d6a..86b2ce3e1 100644 --- a/recipes/recipe_modules/bot_update/api.py +++ b/recipes/recipe_modules/bot_update/api.py @@ -197,6 +197,9 @@ class BotUpdateApi(recipe_api.RecipeApi): # This is necessary because existing builders rely on this behavior, # e.g. they want to force refs/heads/master at the config level. in_commit_repo_path = self._get_commit_repo_path(in_commit, cfg) + # The repo_path that comes back on Windows will have backslashes, which + # won't match the paths that the gclient configs and bot_update script use + in_commit_repo_path = in_commit_repo_path.replace(self.m.path.sep, '/') revisions[in_commit_repo_path] = ( revisions.get(in_commit_repo_path) or in_commit_rev) parsed_solution_urls = set(