From 4baaa11c0100a36a638cda42e17c0938de85d7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Hajdan=2C=20Jr?= Date: Tue, 4 Jul 2017 19:09:32 +0200 Subject: [PATCH] gclient: avoid adding potentially duplicate entries to work queue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The main goal is to provide a migration path, where we can add conditional src-internal entry to src/DEPS, and have it still work on checkouts where .gclient pulls src-internal, provided the condition evaluates to False. The migration path is then to remove the .gclient entry, and at the same time flip the condition to True (e.g. by overriding a variable). Bug: 570091 Change-Id: I9b9850a644463ab0b1f368d65a5cd5f47cf7be97 Reviewed-on: https://chromium-review.googlesource.com/559150 Reviewed-by: Dirk Pranke Commit-Queue: Paweł Hajdan Jr. --- gclient.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gclient.py b/gclient.py index 63c7f2a30..e1b1be2ff 100755 --- a/gclient.py +++ b/gclient.py @@ -909,7 +909,8 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): if self.recursion_limit: # Parse the dependencies of this dependency. for s in self.dependencies: - work_queue.enqueue(s) + if s.should_process: + work_queue.enqueue(s) if command == 'recurse': # Skip file only checkout. @@ -1458,7 +1459,8 @@ it or fix the checkout. self._options.jobs, pm, ignore_requirements=ignore_requirements, verbose=self._options.verbose) for s in self.dependencies: - work_queue.enqueue(s) + if s.should_process: + work_queue.enqueue(s) work_queue.flush(revision_overrides, command, args, options=self._options) if revision_overrides: print('Please fix your script, having invalid --revision flags will soon ' @@ -1570,7 +1572,8 @@ it or fix the checkout. work_queue = gclient_utils.ExecutionQueue( self._options.jobs, None, False, verbose=self._options.verbose) for s in self.dependencies: - work_queue.enqueue(s) + if s.should_process: + work_queue.enqueue(s) work_queue.flush({}, None, [], options=self._options) def GetURLAndRev(dep):