From 0a2356cd39de6603f25e49e105ffdcec505bbde0 Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Fri, 24 Jun 2022 17:49:59 +0000 Subject: [PATCH] Remove redundant should_process check. AFAICT - the code never reaches this point because we already check should process before adding it to the queue. http://shortn/_PWFae17qw4 - this might be necessary if the value of should_process changes between adding it to the queue and running it. But I don't see that happening anywhere. should_process is only ever set and modified here: http://shortn/_eirozAoIm4 which happens during in the parent's run() before the deps get added to the queue. The should_process check that happens at the beginning of run() was added here: https://codereview.chromium.org/3124017/diff/2001/gclient.py The should_process check before a deps gets enqueued was added later here: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/559150/ where several should_process checks were added and I think the author just didn't realize that, while the other methods might need them, run() already had a should_process check. Alternatively, we could remove the should_process check before enqueue-ing. But that would result in enqueuing things that we currently don't enqueue, even if we ultimately don't do anything with it. Change-Id: Ib3be61310c09a681988baa75fd562c7596e9e044 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3721600 Reviewed-by: Josip Sokcevic Commit-Queue: Joanna Wang --- gclient.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gclient.py b/gclient.py index f100cd22f..d678f3c1e 100755 --- a/gclient.py +++ b/gclient.py @@ -933,8 +933,6 @@ class Dependency(gclient_utils.WorkItem, DependencySettings): """Runs |command| then parse the DEPS file.""" logging.info('Dependency(%s).run()' % self.name) assert self._file_list == [] - if not self.should_process: - return # When running runhooks, there's no need to consult the SCM. # All known hooks are expected to run unconditionally regardless of working # copy state, so skip the SCM status check.