Move parsing of TRYSERVER_* so options.root is not overwritten

Since the helper function for the parsing of the TRYSERVER_* variables relies on them being unset (i.e. value is None) in order to apply the settings from codereview.settings, this parsing must take place before the code that figures out the root path (since that sets the options.root value if it's not set). 
Otherwise the TRYSERVER_ROOT setting will never be set, even if configured in codereview.settings, essentially making it useless.

This has probably not been discovered previously since almost all Chrome projects use src as the root dir. In WebRTC and some other projects we use 'trunk' usually, which is giving us trouble in our own try server  setups (where we have to use 'src' because many other scripts have that root dir hardcoded).

I am not sure if there is a case for another project where this change may have any negative effect. Please let me know if theres's any investigation needed that I can assist with.

BUG=none
TEST=submitting try job to local try master with a codereview.settings file with TRYSERVER_ROOT set.

Review URL: https://chromiumcodereview.appspot.com/11574007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@173694 0039d316-1c4b-4281-b951-d872f2087c98
parent 14a98f07
......@@ -168,7 +168,8 @@ class SCM(object):
def AutomagicalSettings(self):
"""Determines settings based on supported code review and checkout tools.
"""
# Try to find gclient or repo root first.
self._GclStyleSettings()
# Try to find gclient or repo root.
if not self.options.no_search:
self.toplevel_root = gclient_utils.FindGclientRoot(self.checkout_root)
if self.toplevel_root:
......@@ -185,8 +186,6 @@ class SCM(object):
self.options.root = gclient_utils.PathDifference(self.toplevel_root,
self.checkout_root)
self._GclStyleSettings()
def ReadRootFile(self, filename):
cur = self.checkout_root
root = self.toplevel_root or self.checkout_root
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment