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

Unified Diff: trychange.py

Issue 243084: Adding an option to specify a default patchlevel in codereview.settings.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trychange.py
===================================================================
--- trychange.py (revision 27906)
+++ trychange.py (working copy)
@@ -94,6 +94,16 @@
settings['http_host'] = gcl.GetCodeReviewSetting('TRYSERVER_HTTP_HOST')
settings['svn_repo'] = gcl.GetCodeReviewSetting('TRYSERVER_SVN_URL')
settings['default_project'] = gcl.GetCodeReviewSetting('TRYSERVER_PROJECT')
+ settings['default_root'] = gcl.GetCodeReviewSetting('TRYSERVER_ROOT')
+
+ # Pick a patchlevel, default to 0.
+ default_patchlevel = gcl.GetCodeReviewSetting('TRYSERVER_PATCHLEVEL')
+ if default_patchlevel:
+ default_patchlevel = int(default_patchlevel)
+ else:
+ default_patchlevel = 0
+ settings['default_patchlevel'] = default_patchlevel
+
# Use http is the http_host name resolve, fallback to svn otherwise.
if (settings['http_port'] and settings['http_host'] and
_SafeResolve(settings['http_host'])):
@@ -462,9 +472,11 @@
help="Url where to grab a patch")
group.add_option("--root",
help="Root to use for the patch; base subdirectory for "
- "patch created in a subdirectory")
+ "patch created in a subdirectory",
+ default=default_settings["default_root"])
group.add_option("--patchlevel", type='int', metavar="LEVEL",
- help="Used as -pN parameter to patch")
+ help="Used as -pN parameter to patch",
+ default=default_settings["default_patchlevel"])
parser.add_option_group(group)
group = optparse.OptionGroup(parser, "Access the try server by HTTP")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698