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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 try: | 580 try: |
581 # Location of the latest build revision number | 581 # Location of the latest build revision number |
582 return int(urllib.urlopen(url).read()) | 582 return int(urllib.urlopen(url).read()) |
583 except Exception, e: | 583 except Exception, e: |
584 print('Could not determine latest revision. This could be bad...') | 584 print('Could not determine latest revision. This could be bad...') |
585 return 999999999 | 585 return 999999999 |
586 | 586 |
587 | 587 |
588 def main(): | 588 def main(): |
589 usage = ('%prog [options] [-- chromium-options]\n' | 589 usage = ('%prog [options] [-- chromium-options]\n' |
590 'Perform binary search on the snapshot builds to find a minimal ' | 590 'Perform binary search on the snapshot builds to find a minimal\n' |
591 'range of revisions where a behavior change happened. The ' | 591 'range of revisions where a behavior change happened. The\n' |
592 'behaviors are described as "good" and "bad". ' | 592 'behaviors are described as "good" and "bad".\n' |
593 'It is NOT assumed that the behavior of the later revision is ' | 593 'It is NOT assumed that the behavior of the later revision is\n' |
594 'the bad one.\n' | 594 'the bad one.\n' |
595 '\n' | 595 '\n' |
| 596 'Revision numbers should use\n' |
| 597 ' Official versions (e.g. 1.0.1000.0) for official builds. (-o)\n' |
| 598 ' SVN revisions (e.g. 123456) for chromium builds, from trunk.\n' |
| 599 ' Use base_trunk_revision from http://omahaproxy.appspot.com/\n' |
| 600 ' for earlier revs.\n' |
| 601 ' Chrome\'s about: build number and omahaproxy branch_revision\n' |
| 602 ' are incorrect, they are from branches.\n' |
| 603 '\n' |
596 'Tip: add "-- --no-first-run" to bypass the first run prompts.') | 604 'Tip: add "-- --no-first-run" to bypass the first run prompts.') |
597 parser = optparse.OptionParser(usage=usage) | 605 parser = optparse.OptionParser(usage=usage) |
598 # Strangely, the default help output doesn't include the choice list. | 606 # Strangely, the default help output doesn't include the choice list. |
599 choices = ['mac', 'win', 'linux', 'linux64'] | 607 choices = ['mac', 'win', 'linux', 'linux64'] |
600 # linux-chromiumos lacks a continuous archive http://crbug.com/78158 | 608 # linux-chromiumos lacks a continuous archive http://crbug.com/78158 |
601 parser.add_option('-a', '--archive', | 609 parser.add_option('-a', '--archive', |
602 choices = choices, | 610 choices = choices, |
603 help = 'The buildbot archive to bisect [%s].' % | 611 help = 'The buildbot archive to bisect [%s].' % |
604 '|'.join(choices)) | 612 '|'.join(choices)) |
605 parser.add_option('-o', action="store_true", dest='official_builds', | 613 parser.add_option('-o', action="store_true", dest='official_builds', |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 print 'WEBKIT CHANGELOG URL:' | 688 print 'WEBKIT CHANGELOG URL:' |
681 print ' ' + WEBKIT_CHANGELOG_URL % (max_webkit_rev, min_webkit_rev) | 689 print ' ' + WEBKIT_CHANGELOG_URL % (max_webkit_rev, min_webkit_rev) |
682 print 'CHANGELOG URL:' | 690 print 'CHANGELOG URL:' |
683 if opts.official_builds: | 691 if opts.official_builds: |
684 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 692 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
685 else: | 693 else: |
686 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 694 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
687 | 695 |
688 if __name__ == '__main__': | 696 if __name__ == '__main__': |
689 sys.exit(main()) | 697 sys.exit(main()) |
OLD | NEW |