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

Side by Side Diff: tools/bisect-builds.py

Issue 1131403003: bisect-builds.py: Save cache in parent scope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Snapshot Build Bisect Tool 6 """Snapshot Build Bisect Tool
7 7
8 This script bisects a snapshot archive using binary search. It starts at 8 This script bisects a snapshot archive using binary search. It starts at
9 a bad revision (it will try to guess HEAD) and asks for a last known-good 9 a bad revision (it will try to guess HEAD) and asks for a last known-good
10 revision. It will then binary search across this revision range by downloading, 10 revision. It will then binary search across this revision range by downloading,
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 # The cache is stored in the same directory as bisect-builds.py 437 # The cache is stored in the same directory as bisect-builds.py
438 cache_filename = os.path.join( 438 cache_filename = os.path.join(
439 os.path.abspath(os.path.dirname(__file__)), 439 os.path.abspath(os.path.dirname(__file__)),
440 '.bisect-builds-cache.json') 440 '.bisect-builds-cache.json')
441 cache_dict_key = self.GetListingURL() 441 cache_dict_key = self.GetListingURL()
442 442
443 def _LoadBucketFromCache(): 443 def _LoadBucketFromCache():
444 if self.use_local_cache: 444 if self.use_local_cache:
445 try: 445 try:
446 with open(cache_filename) as cache_file: 446 with open(cache_filename) as cache_file:
447 cache = json.load(cache_file) 447 for (key, value) in json.load(cache_file).items():
448 cache[key] = value
448 revisions = cache.get(cache_dict_key, []) 449 revisions = cache.get(cache_dict_key, [])
449 githash_svn_dict = cache.get('githash_svn_dict', {}) 450 githash_svn_dict = cache.get('githash_svn_dict', {})
450 if revisions: 451 if revisions:
451 print 'Loaded revisions %d-%d from %s' % (revisions[0], 452 print 'Loaded revisions %d-%d from %s' % (revisions[0],
452 revisions[-1], cache_filename) 453 revisions[-1], cache_filename)
453 return (revisions, githash_svn_dict) 454 return (revisions, githash_svn_dict)
454 except (EnvironmentError, ValueError): 455 except (EnvironmentError, ValueError):
455 pass 456 pass
456 return ([], {}) 457 return ([], {})
457 458
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 1276
1276 print 'CHANGELOG URL:' 1277 print 'CHANGELOG URL:'
1277 if opts.official_builds: 1278 if opts.official_builds:
1278 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) 1279 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev)
1279 else: 1280 else:
1280 PrintChangeLog(min_chromium_rev, max_chromium_rev) 1281 PrintChangeLog(min_chromium_rev, max_chromium_rev)
1281 1282
1282 1283
1283 if __name__ == '__main__': 1284 if __name__ == '__main__':
1284 sys.exit(main()) 1285 sys.exit(main())
OLDNEW
« 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