Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: gclient.py

Issue 18541006: If we're running in nohooks mode, don't bother to accumulate file_list in gclient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Rebase and mark the rest of the optional args Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index f7c9cc18be88abb0aedd3913e1ab223d608c34d4..2d661b30ebf01bff727b2756311fbaf305e33122 100755
--- a/gclient.py
+++ b/gclient.py
@@ -591,7 +591,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# copy state, so skip the SCM status check.
run_scm = command not in ('runhooks', 'recurse', None)
parsed_url = self.LateOverride(self.url)
- file_list = []
+ file_list = [] if not options.nohooks else None
if run_scm and parsed_url:
if isinstance(parsed_url, self.FileImpl):
# Special support for single-file checkout.
@@ -612,11 +612,12 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
self._used_scm = gclient_scm.CreateSCM(
parsed_url, self.root.root_dir, self.name)
self._used_scm.RunCommand(command, options, args, file_list)
- file_list = [os.path.join(self.name, f.strip()) for f in file_list]
+ if file_list:
+ file_list = [os.path.join(self.name, f.strip()) for f in file_list]
# TODO(phajdan.jr): We should know exactly when the paths are absolute.
# Convert all absolute paths to relative.
- for i in range(len(file_list)):
+ for i in range(len(file_list or [])):
# It depends on the command being executed (like runhooks vs sync).
if not os.path.isabs(file_list[i]):
continue
@@ -630,7 +631,7 @@ class Dependency(gclient_utils.WorkItem, DependencySettings):
# Always parse the DEPS file.
self.ParseDepsFile()
- self._run_is_done(file_list, parsed_url)
+ self._run_is_done(file_list or [], parsed_url)
if self.recursion_limit:
# Parse the dependencies of this dependency.
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698