| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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()) |
| OLD | NEW |