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

Unified Diff: recipe_modules/bot_update/resources/apply_gerrit.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 | « recipe_modules/bot_update/example.expected/apply_gerrit_ref.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/bot_update/resources/apply_gerrit.py
diff --git a/recipe_modules/bot_update/resources/apply_gerrit.py b/recipe_modules/bot_update/resources/apply_gerrit.py
new file mode 100755
index 0000000000000000000000000000000000000000..7cfa20452d1a7b544a00949fa0a47cfa342ea0f9
--- /dev/null
+++ b/recipe_modules/bot_update/resources/apply_gerrit.py
@@ -0,0 +1,33 @@
+#!/usr/bin/env python
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import optparse
+import sys
+
+import bot_update # pylint: disable=relative-import
+
+
+if __name__ == '__main__':
+ parse = optparse.OptionParser()
+
+ parse.add_option('--gerrit_repo',
+ help='Gerrit repository to pull the ref from.')
+ parse.add_option('--gerrit_ref', help='Gerrit ref to apply.')
+ parse.add_option('--root', help='The location of the checkout.')
+ parse.add_option('--gerrit_no_reset', action='store_true',
+ help='Bypass calling reset after applying a gerrit ref.')
+ parse.add_option('--gerrit_rebase_patch_ref', action='store_true',
+ help='Rebase Gerrit patch ref after of checking it out.')
+
+ options, _ = parse.parse_args()
+
+ sys.exit(
+ bot_update.apply_gerrit_ref(
+ options.gerrit_repo,
+ options.gerrit_ref,
+ options.root,
+ not options.gerrit_no_reset,
+ options.gerrit_rebase_patch_ref)
+ )
« no previous file with comments | « recipe_modules/bot_update/example.expected/apply_gerrit_ref.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698