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

Unified Diff: win_toolchain/get_toolchain_if_necessary.py

Issue 2092753003: Limit the number of extra/missing files that get printed. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win_toolchain/get_toolchain_if_necessary.py
diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py
index d7d20b820354009696bee0cdb6c17d49fbeba65b..4e676327e222c576152834f060351ae9a0336a99 100755
--- a/win_toolchain/get_toolchain_if_necessary.py
+++ b/win_toolchain/get_toolchain_if_necessary.py
@@ -140,16 +140,22 @@ def CalculateHash(root, expected_hash):
timestamps_data_files.append(f[0])
missing_files = [f for f in timestamps_data_files if f not in file_list]
if len(missing_files):
- print ('Some files are missing from the %s version of the toolchain:' %
- expected_hash)
- for f in missing_files:
- print '\t%s' % f
+ print ('%d file%s missing from the %s version of the toolchain:' %
+ (len(missing_files), 's are' if len(missing_files) > 1 else '',
Nico 2016/06/23 15:53:45 nit: i'd just say "%d files missing", it's not lik
Sébastien Marchand 2016/06/23 15:57:51 Done.
+ expected_hash))
+ for i in xrange(0, min(len(missing_files), 10)):
+ print '\t%s' % missing_files[i]
+ if len(missing_files) > 10:
+ print '\t...'
extra_files = [f for f in file_list if f not in timestamps_data_files]
if len(extra_files):
- print ('There\'s some extra files in the %s version of the toolchain:' %
- expected_hash)
- for f in extra_files:
- print '\t%s' % f
+ print ('There\'s %d extra file%s in the %s version of the toolchain:' %
Nico 2016/06/23 15:53:44 same nit: drop "There's", and i'd always just say
Sébastien Marchand 2016/06/23 15:57:51 Done.
+ (len(extra_files), 's' if len(missing_files) > 1 else '',
+ expected_hash))
+ for i in xrange(0, min(len(extra_files), 10)):
+ print '\t%s' % extra_files[i]
+ if len(extra_files) > 10:
+ print '\t...'
if matches:
return timestamps_data['sha1']
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698