Commit b9be065a authored by maruel@chromium.org's avatar maruel@chromium.org

Do not sort solutions anymore, only dependencies specified in DEPS files.

Otherwise it breaks naked --revision usage. One example issue is linux_chromeos
applying the revision to cros_deps instead of src.

TBR=dpranke@chromium.org
BUG=100335
TEST=


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@105522 0039d316-1c4b-4281-b951-d872f2087c98
parent 69392e7c
...@@ -465,12 +465,13 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): ...@@ -465,12 +465,13 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
deps_to_add.append(Dependency( deps_to_add.append(Dependency(
self, name, url, None, None, None, None, self, name, url, None, None, None, None,
self.deps_file, should_process)) self.deps_file, should_process))
deps_to_add.sort(key=lambda x: x.name)
self.add_dependencies_and_close(deps_to_add, local_scope.get('hooks', [])) self.add_dependencies_and_close(deps_to_add, local_scope.get('hooks', []))
logging.info('ParseDepsFile(%s) done' % self.name) logging.info('ParseDepsFile(%s) done' % self.name)
def add_dependencies_and_close(self, deps_to_add, hooks): def add_dependencies_and_close(self, deps_to_add, hooks):
"""Adds the dependencies, hooks and mark the parsing as done.""" """Adds the dependencies, hooks and mark the parsing as done."""
for dep in sorted(deps_to_add, key=lambda x: x.name): for dep in deps_to_add:
if dep.verify_validity(): if dep.verify_validity():
self.add_dependency(dep) self.add_dependency(dep)
self._mark_as_parsed(hooks) self._mark_as_parsed(hooks)
......
...@@ -157,19 +157,11 @@ class GclientTest(trial_dir.TestCase): ...@@ -157,19 +157,11 @@ class GclientTest(trial_dir.TestCase):
actual[3:]) actual[3:])
self.assertEquals(3, len(obj.dependencies)) self.assertEquals(3, len(obj.dependencies))
self.assertEquals('bar', obj.dependencies[0].name) self.assertEquals('foo', obj.dependencies[0].name)
self.assertEquals('bar/empty', obj.dependencies[1].name) self.assertEquals('bar', obj.dependencies[1].name)
self.assertEquals('foo', obj.dependencies[2].name) self.assertEquals('bar/empty', obj.dependencies[2].name)
self._check_requirements( self._check_requirements(
obj.dependencies[0], obj.dependencies[0],
{
'foo/dir1/dir2': ['bar', 'bar/empty', 'foo', 'foo/dir1'],
})
self._check_requirements(
obj.dependencies[1],
{})
self._check_requirements(
obj.dependencies[2],
{ {
'foo/dir1': ['bar', 'bar/empty', 'foo'], 'foo/dir1': ['bar', 'bar/empty', 'foo'],
'foo/dir1/dir2/dir3': 'foo/dir1/dir2/dir3':
...@@ -181,6 +173,14 @@ class GclientTest(trial_dir.TestCase): ...@@ -181,6 +173,14 @@ class GclientTest(trial_dir.TestCase):
[ 'bar', 'bar/empty', 'foo', 'foo/dir1', 'foo/dir1/dir2', [ 'bar', 'bar/empty', 'foo', 'foo/dir1', 'foo/dir1/dir2',
'foo/dir1/dir2/dir3/dir4'], 'foo/dir1/dir2/dir3/dir4'],
}) })
self._check_requirements(
obj.dependencies[1],
{
'foo/dir1/dir2': ['bar', 'bar/empty', 'foo', 'foo/dir1'],
})
self._check_requirements(
obj.dependencies[2],
{})
self._check_requirements( self._check_requirements(
obj, obj,
{ {
......
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