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

Unified Diff: tools/binary_size/diagnose_bloat.py

Issue 2876033002: diagnose_bloat.py: fix broken --subrepo. (Closed)
Patch Set: user accept message spacing Created 3 years, 7 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: tools/binary_size/diagnose_bloat.py
diff --git a/tools/binary_size/diagnose_bloat.py b/tools/binary_size/diagnose_bloat.py
index 9ec641ab1035fe74d920fcc043075730816d761d..37b5e88690d9a7363d0c990e8113dddf15f20e83 100755
--- a/tools/binary_size/diagnose_bloat.py
+++ b/tools/binary_size/diagnose_bloat.py
@@ -519,15 +519,16 @@ def _FindToolPrefix(output_directory):
def _SyncAndBuild(archive, build, subrepo):
"""Sync, build and return non 0 if any commands failed."""
# Simply do a checkout if subrepo is used.
+ retcode = 0
if subrepo != _SRC_ROOT:
_GitCmd(['checkout', archive.rev], subrepo)
- return 0
else:
# Move to a detached state since gclient sync doesn't work with local
# commits on a branch.
_GitCmd(['checkout', '--detach'], subrepo)
logging.info('Syncing to %s', archive.rev)
- return _GclientSyncCmd(archive.rev, subrepo) or build.Run()
+ retcode = _GclientSyncCmd(archive.rev, subrepo)
+ return retcode or build.Run()
def _GenerateRevList(rev, reference_rev, all_in_range, subrepo):
@@ -545,7 +546,7 @@ def _GenerateRevList(rev, reference_rev, all_in_range, subrepo):
revs = [all_revs[0], all_revs[-1]]
if len(revs) >= _COMMIT_COUNT_WARN_THRESHOLD:
_VerifyUserAccepts(
- 'You\'ve provided a commit range that contains %d commits' % len(revs))
+ 'You\'ve provided a commit range that contains %d commits.' % len(revs))
return revs
@@ -569,7 +570,7 @@ def _ValidateRevs(rev, reference_rev, subrepo):
def _VerifyUserAccepts(message):
- print message + 'Do you want to proceed? [y/n]'
+ print message + ' Do you want to proceed? [y/n]'
if raw_input('> ').lower() != 'y':
sys.exit()
@@ -761,7 +762,7 @@ def main():
_EnsureDirectoryClean(subrepo)
_SetRestoreFunc(subrepo)
if build.IsLinux():
- _VerifyUserAccepts('Linux diffs have known deficiencies (crbug/717550). ')
+ _VerifyUserAccepts('Linux diffs have known deficiencies (crbug/717550).')
rev, reference_rev = _ValidateRevs(
args.rev, args.reference_rev or args.rev + '^', subrepo)
« 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