Commit 4e9b50ab authored by Michael Moss's avatar Michael Moss Committed by Commit Bot

Revert recent gclient.py changes to fix Chrome releases.

Reason for revert: This is breaking official release scripts, which have long
used "None" URL functionality to allow gclient commands to run against
"local" DEPS (buildspec) files. Please do not remove this behavior.

This reverts the following commits:
  ebdd0db4: "gclient: Remove URLs from hierarchy."
  54a5c2ba: "gclient: Refactor PrintRevInfo"
  083eb25f: "gclient: Don't allow URL to be None."

BUG=846194

TBR=agable@chromium.org,ehmaldonado@chromium.org

Change-Id: Ibdd5581889bd4afd86474199c7b64555f01bbbca
Reviewed-on: https://chromium-review.googlesource.com/1070893
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: 's avatarMichael Moss <mmoss@chromium.org>
parent 1f156687
This diff is collapsed.
......@@ -9,4 +9,4 @@ As the CI needs of the browser grew, Batty, the Build and Test Yeti, got
a new friend:
The End.
The End!
......@@ -246,14 +246,9 @@ class GClientSmoke(GClientSmokeBase):
']\n'
'cache_dir = None\n') % self.git_base)
os.remove(p)
results = self.gclient(['config', '--spec', '["blah blah"]'])
self.assertEqual(('', 'Error: No solution specified\n', 1), results)
results = self.gclient(['config', '--spec',
'solutions=[{"name": "./", "url": None}]'])
self.assertEqual(('', 'Error: No solution specified\n', 1), results)
test(['config', '--spec', '["blah blah"]'], '["blah blah"]')
os.remove(p)
results = self.gclient(['config', 'foo', 'faa', 'fuu'])
err = ('Usage: gclient.py config [options] [url]\n\n'
'gclient.py: error: Inconsistent arguments. Use either --spec or one'
......@@ -261,6 +256,24 @@ class GClientSmoke(GClientSmokeBase):
self.check(('', err, 2), results)
self.assertFalse(os.path.exists(join(self.root_dir, '.gclient')))
def testSolutionNone(self):
results = self.gclient(['config', '--spec',
'solutions=[{"name": "./", "url": None}]'])
self.check(('', '', 0), results)
results = self.gclient(['sync'])
self.check(('', '', 0), results)
self.assertTree({})
results = self.gclient(['revinfo'])
self.check(('./: None\n', '', 0), results)
self.check(('', '', 0), self.gclient(['diff']))
self.assertTree({})
self.check(('', '', 0), self.gclient(['pack']))
self.check(('', '', 0), self.gclient(['revert']))
self.assertTree({})
self.check(('', '', 0), self.gclient(['runhooks']))
self.assertTree({})
self.check(('', '', 0), self.gclient(['status']))
def testDifferentTopLevelDirectory(self):
# Check that even if the .gclient file does not mention the directory src
# itself, but it is included via dependencies, the .gclient file is used.
......@@ -796,10 +809,8 @@ class GClientSmokeGIT(GClientSmokeBase):
with open(output_json) as f:
output_json = json.load(f)
self.maxDiff = None
out = [{
'solution_url': '%srepo_1@%s' % (
self.git_base, self.githash('repo_1', 2)),
'solution_url': self.git_base + 'repo_1',
'managed': True,
'name': 'src',
'deps_file': 'DEPS',
......
......@@ -202,7 +202,7 @@ class GclientTest(trial_dir.TestCase):
url = 'proto://host/path/@revision'
d = gclient.Dependency(
None, 'name', url, url, None, None, None,
None, '', False, None, True)
None, '', True, False, None, True)
self.assertEquals('proto://host/path@revision', d.url)
def testStr(self):
......@@ -213,17 +213,17 @@ class GclientTest(trial_dir.TestCase):
[
gclient.Dependency(
obj, 'foo', 'svn://example.com/foo', 'svn://example.com/foo', None,
None, None, None, 'DEPS', False, None, True),
None, None, None, 'DEPS', True, False, None, True),
gclient.Dependency(
obj, 'bar', 'svn://example.com/bar', 'svn://example.com/bar', None,
None, None, None, 'DEPS', False, None, True),
None, None, None, 'DEPS', True, False, None, True),
],
[])
obj.dependencies[0].add_dependencies_and_close(
[
gclient.Dependency(
obj.dependencies[0], 'foo/dir1', 'svn://example.com/foo/dir1',
'svn://example.com/foo/dir1', None, None, None, None, 'DEPS',
'svn://example.com/foo/dir1', None, None, None, None, 'DEPS', True,
False, None, True),
],
[])
......@@ -232,7 +232,7 @@ class GclientTest(trial_dir.TestCase):
# pylint: disable=protected-access
obj.dependencies[0]._file_list.append('foo')
str_obj = str(obj)
self.assertEquals(230, len(str_obj), '%d\n%s' % (len(str_obj), str_obj))
self.assertEquals(322, len(str_obj), '%d\n%s' % (len(str_obj), str_obj))
def testHooks(self):
topdir = self.root_dir
......@@ -543,12 +543,14 @@ class GclientTest(trial_dir.TestCase):
('foo/rel', 'svn://example.com/rel'),
], self._get_processed())
self.assertEqual(4, len(sol.dependencies))
self.assertEqual(6, len(sol.dependencies))
self.assertEqual([
('foo/bar', 'svn://example.com/override'),
('foo/baz', 'svn://example.com/baz'),
('foo/new', 'svn://example.com/new'),
('foo/rel', 'svn://example.com/rel'),
('foo/skip', None),
('foo/skip2', None),
], [(dep.name, dep.url) for dep in sol.dependencies])
def testDepsOsOverrideDepsInDepsFile(self):
......@@ -1129,7 +1131,8 @@ class GclientTest(trial_dir.TestCase):
[
gclient.Dependency(
obj, 'foo', 'svn://example.com/foo', 'svn://example.com/foo', None,
None, None, None, 'DEPS', False, None, True),
None, None, None, 'DEPS', True,
False, None, True),
],
[])
obj.dependencies[0].add_dependencies_and_close(
......@@ -1137,12 +1140,12 @@ class GclientTest(trial_dir.TestCase):
gclient.CipdDependency(obj.dependencies[0], 'foo',
{'package': 'foo_package',
'version': 'foo_version'},
cipd_root, None, False,
cipd_root, None, True, False,
'fake_condition'),
gclient.CipdDependency(obj.dependencies[0], 'foo',
{'package': 'bar_package',
'version': 'bar_version'},
cipd_root, None, False,
cipd_root, None, True, False,
'fake_condition'),
],
[])
......
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