Revert "Do not blindly assume that a .gclient file in a parent directory belongs to the cur..."

This reverts commit 58352.

TBR=jochen
BUG=breaks build bots

Review URL: http://codereview.chromium.org/3334005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@58355 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
maruel@chromium.org 15 years ago
parent b96b92f662
commit d765d9c848

@ -621,24 +621,13 @@ solutions = [
def LoadCurrentConfig(options):
"""Searches for and loads a .gclient file relative to the current working
dir. Returns a GClient object."""
cwd = os.getcwd()
path = gclient_utils.FindGclientRoot(cwd, options.config_filename)
path = gclient_utils.FindGclientRoot(os.getcwd(), options.config_filename)
if not path:
return None
client = GClient(path, options)
client.SetConfig(gclient_utils.FileRead(
os.path.join(path, options.config_filename)))
if path == cwd:
return client
# Validate the current directory we are in belongs to the .gclient file we
# found.
cwd = cwd[len(path)+1:]
all_solutions = client.tree(False)
while len(cwd):
if cwd in all_solutions:
return client
cwd = os.path.dirname(cwd)
return None
return client
def SetDefaultConfig(self, solution_name, solution_url, safesync_url):
self.SetConfig(self.DEFAULT_CLIENT_FILE_TEXT % {

@ -145,14 +145,6 @@ class GClientSmoke(GClientSmokeBase):
self.check(res, self.gclient(['sync']))
self.check(res, self.gclient(['update']))
def testWrongConfig(self):
# tested in testConfig.
self.gclient(['config', self.svn_base + 'trunk/src/'])
other_src = join(self.root_dir, 'src-other')
os.mkdir(other_src)
res = ('', 'Error: client not configured; see \'gclient config\'\n', 1)
self.check(res, self.gclient(['status'], other_src))
def testConfig(self):
p = join(self.root_dir, '.gclient')
def test(cmd, expected):

Loading…
Cancel
Save