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

Unified Diff: recipe_modules/bot_update/api.py

Issue 2249983004: Add apply_gerrit_ref to bot_update api (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: disable=relative-import Created 4 years, 4 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 | « no previous file | 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 2e62e6fd2481378482dbe7a8ba02d4a5d2acdead..9bee87cb5d064f48e2c4c889d70ca6eeea6bcd1d 100644
--- a/recipe_modules/bot_update/api.py
+++ b/recipe_modules/bot_update/api.py
@@ -53,6 +53,27 @@ class BotUpdateApi(recipe_api.RecipeApi):
def last_returned_properties(self):
return self._last_returned_properties
+ # DO NOT USE.
+ # The below method will be removed after there are no more callers of
+ # tryserver.maybe_apply_issue (skbug.com/5588).
+ def apply_gerrit_ref(self, root, gerrit_no_reset=False,
+ gerrit_rebase_patch_ref=True, **kwargs):
+ apply_gerrit_path = self.resource('apply_gerrit.py')
+ kwargs.setdefault('infra_step', True)
+ kwargs.setdefault('env', {}).setdefault('PATH', '%(PATH)s')
+ kwargs['env']['PATH'] = self.m.path.pathsep.join([
+ kwargs['env']['PATH'], str(self._module.PACKAGE_REPO_ROOT)])
+ cmd = [
+ '--gerrit_repo', self._repository,
+ '--gerrit_ref', self._gerrit_ref or '',
+ '--root', str(root),
+ ]
+ if gerrit_no_reset:
+ cmd.append('--gerrit_no_reset')
+ if gerrit_rebase_patch_ref:
+ cmd.append('--gerrit_rebase_patch_ref')
+ return self.m.python('apply_gerrit', apply_gerrit_path, cmd, **kwargs)
+
def ensure_checkout(self, gclient_config=None, suffix=None,
patch=True, update_presentation=True,
force=False, patch_root=None, no_shallow=False,
« no previous file with comments | « no previous file | recipe_modules/bot_update/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698