| 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 pass | 309 pass |
| 310 else: | 310 else: |
| 311 all_prefixes = document.findall(namespace + 'CommonPrefixes/' + | 311 all_prefixes = document.findall(namespace + 'CommonPrefixes/' + |
| 312 namespace + 'Prefix') | 312 namespace + 'Prefix') |
| 313 # The <Prefix> nodes have content of the form of | 313 # The <Prefix> nodes have content of the form of |
| 314 # |_listing_platform_dir/revision/|. Strip off the platform dir and the | 314 # |_listing_platform_dir/revision/|. Strip off the platform dir and the |
| 315 # trailing slash to just have a number. | 315 # trailing slash to just have a number. |
| 316 for prefix in all_prefixes: | 316 for prefix in all_prefixes: |
| 317 revnum = prefix.text[prefix_len:-1] | 317 revnum = prefix.text[prefix_len:-1] |
| 318 try: | 318 try: |
| 319 if not revnum.isdigit(): | 319 revnum = int(revnum) |
| 320 # During the svn-git migration, some items were stored by hash. | 320 revisions.append(revnum) |
| 321 # These items may appear anywhere in the list of items. | 321 # Notes: |
| 322 # If |last_known_rev| is set, assume that the full list has been | 322 # Ignore hash in chromium-browser-snapshots as they are invalid |
| 323 # retrieved before (including the hashes), so we can safely skip | 323 # Resulting in 404 error in fetching pages: |
| 324 # all git hashes and focus on the numeric revision numbers. | 324 # https://chromium.googlesource.com/chromium/src/+/[rev_hash] |
| 325 if last_known_rev: | |
| 326 revnum = None | |
| 327 else: | |
| 328 git_hash = revnum | |
| 329 revnum = self.GetSVNRevisionFromGitHash(git_hash) | |
| 330 githash_svn_dict[revnum] = git_hash | |
| 331 if revnum is not None: | |
| 332 revnum = int(revnum) | |
| 333 revisions.append(revnum) | |
| 334 except ValueError: | 325 except ValueError: |
| 335 pass | 326 pass |
| 336 return (revisions, next_marker, githash_svn_dict) | 327 return (revisions, next_marker, githash_svn_dict) |
| 337 | 328 |
| 338 # Fetch the first list of revisions. | 329 # Fetch the first list of revisions. |
| 339 if last_known_rev: | 330 if last_known_rev: |
| 340 revisions = [] | 331 revisions = [] |
| 341 # Optimization: Start paging at the last known revision (local cache). | 332 # Optimization: Start paging at the last known revision (local cache). |
| 342 next_marker = _GetMarkerForRev(last_known_rev) | 333 next_marker = _GetMarkerForRev(last_known_rev) |
| 343 # Optimization: Stop paging at the last known revision (remote). | 334 # Optimization: Stop paging at the last known revision (remote). |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 | 1300 |
| 1310 print 'CHANGELOG URL:' | 1301 print 'CHANGELOG URL:' |
| 1311 if opts.official_builds: | 1302 if opts.official_builds: |
| 1312 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 1303 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| 1313 else: | 1304 else: |
| 1314 PrintChangeLog(min_chromium_rev, max_chromium_rev) | 1305 PrintChangeLog(min_chromium_rev, max_chromium_rev) |
| 1315 | 1306 |
| 1316 | 1307 |
| 1317 if __name__ == '__main__': | 1308 if __name__ == '__main__': |
| 1318 sys.exit(main()) | 1309 sys.exit(main()) |
| OLD | NEW |