Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1065)

Unified Diff: recipe_modules/bot_update/api.py

Issue 1917433002: Generalize patch_project to patch root conversion. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: -line long Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_modules/bot_update/__init__.py ('k') | recipe_modules/bot_update/example.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/bot_update/api.py
diff --git a/recipe_modules/bot_update/api.py b/recipe_modules/bot_update/api.py
index 31a27335c82c2d67528b6906cce51b748dfd6c98..1f93e61796eceaa2c0fd0047fa5043ada0da10d2 100644
--- a/recipe_modules/bot_update/api.py
+++ b/recipe_modules/bot_update/api.py
@@ -85,6 +85,17 @@ class BotUpdateApi(recipe_api.RecipeApi):
# Construct our bot_update command. This basically be inclusive of
# everything required for bot_update to know:
root = patch_root
+ if root == 'TODO(TANDRII): REMOVE THIS TRANSITION TO patch_projects':
+ # This special condition is here for initial rollout of this code,
+ # because it's hard to test this change without rolling into build
+ # repository.
+ # After the switch to new code is complete, this special TODOstring will
+ # be removed in favor of "root is None"
+ assert patch_project_roots is None
+ root = self.m.gclient.calculate_patch_root(
+ self.m.properties.get('patch_project'), cfg)
+ # TODO(tandrii): get rid the condition below after transition.
+
if root is None:
root = cfg.solutions[0].name
additional = self.m.rietveld.calculate_issue_root(patch_project_roots)
@@ -128,6 +139,12 @@ class BotUpdateApi(recipe_api.RecipeApi):
else:
email_file = key_file = None
+ # Allow patch_project's revision if necessary.
+ # This is important for projects which are checked out as DEPS of the
+ # gclient solution.
+ self.m.gclient.set_patch_project_revision(
+ self.m.properties.get('patch_project'), cfg)
+
rev_map = cfg.got_revision_mapping.as_jsonish()
flags = [
« no previous file with comments | « recipe_modules/bot_update/__init__.py ('k') | recipe_modules/bot_update/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698