From 0870df2817d9f736f8a899103ab87b73487fa63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Hajdan=2C=20Jr?= Date: Wed, 23 Aug 2017 17:59:29 +0200 Subject: [PATCH] gclient flatten: only print DEPS info referenced by recursedeps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: 756474, 570091 Change-Id: I8777b611f2b77b71cf75ec64ec1f0afca2104235 Reviewed-on: https://chromium-review.googlesource.com/629082 Reviewed-by: Michael Moss Commit-Queue: Paweł Hajdan Jr. --- gclient.py | 4 ++++ tests/gclient_smoketest.py | 10 ---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/gclient.py b/gclient.py index a8e8770ad4..89fbc27aab 100755 --- a/gclient.py +++ b/gclient.py @@ -1768,6 +1768,10 @@ class Flattener(object): deps_files = set() def add_deps_file(dep): + # Only include DEPS files referenced by recursedeps. + if not (dep.parent is None or + (dep.name in (dep.parent.recursedeps or {}))): + return deps_path = os.path.join(self._client.root_dir, dep.name, dep.deps_file) if not os.path.exists(deps_path): return diff --git a/tests/gclient_smoketest.py b/tests/gclient_smoketest.py index f1ffefce88..ffcbd19fee 100755 --- a/tests/gclient_smoketest.py +++ b/tests/gclient_smoketest.py @@ -719,8 +719,6 @@ class GClientSmokeGIT(GClientSmokeBase): '', '# git://127.0.0.1:20000/git/repo_2@%s, DEPS' % ( self.githash('repo_2', 1)[:7]), - '# git://127.0.0.1:20000/git/repo_5, DEPS', - '# git://127.0.0.1:20000/git/repo_6, DEPS', '# git://127.0.0.1:20000/git/repo_8, DEPS' ], deps_contents.splitlines()) @@ -876,10 +874,6 @@ class GClientSmokeGIT(GClientSmokeBase): '', '# git://127.0.0.1:20000/git/repo_2@%s, DEPS' % ( self.githash('repo_2', 1)), - '# git://127.0.0.1:20000/git/repo_5@%s, DEPS' % ( - self.githash('repo_5', 3)), - '# git://127.0.0.1:20000/git/repo_6@%s, DEPS' % ( - self.githash('repo_6', 1)), '# git://127.0.0.1:20000/git/repo_8@%s, DEPS' % ( self.githash('repo_8', 1)), ], deps_contents.splitlines()) @@ -977,11 +971,7 @@ class GClientSmokeGIT(GClientSmokeBase): '', '}', '', - '# git://127.0.0.1:20000/git/repo_10, DEPS', '# git://127.0.0.1:20000/git/repo_11, DEPS', - '# git://127.0.0.1:20000/git/repo_5, DEPS', - '# git://127.0.0.1:20000/git/repo_6, DEPS', - '# git://127.0.0.1:20000/git/repo_7, DEPS', '# git://127.0.0.1:20000/git/repo_8, DEPS', '# git://127.0.0.1:20000/git/repo_9, DEPS', ], deps_contents.splitlines())