gclient: avoid adding potentially duplicate entries to work queue
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 <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
diff --git a/gclient.py b/gclient.py
index 63c7f2a..e1b1be2 100755
--- a/gclient.py
+++ b/gclient.py
@@ -909,7 +909,8 @@
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 @@
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 @@
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):