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.\n' | 590 'Perform binary search on the snapshot builds to find a minimal ' |
591 'range of revisions where a behavior change happened. The ' | |
592 'behaviors are described as "good" and "bad". ' | |
593 'It is NOT assumed that the behavior of the later revision is ' | |
594 'the bad one.\n' | |
591 '\n' | 595 '\n' |
592 'Tip: add "-- --no-first-run" to bypass the first run prompts.') | 596 'Tip: add "-- --no-first-run" to bypass the first run prompts.') |
593 parser = optparse.OptionParser(usage=usage) | 597 parser = optparse.OptionParser(usage=usage) |
594 # Strangely, the default help output doesn't include the choice list. | 598 # Strangely, the default help output doesn't include the choice list. |
595 choices = ['mac', 'win', 'linux', 'linux64'] | 599 choices = ['mac', 'win', 'linux', 'linux64'] |
596 # linux-chromiumos lacks a continuous archive http://crbug.com/78158 | 600 # linux-chromiumos lacks a continuous archive http://crbug.com/78158 |
597 parser.add_option('-a', '--archive', | 601 parser.add_option('-a', '--archive', |
598 choices = choices, | 602 choices = choices, |
599 help = 'The buildbot archive to bisect [%s].' % | 603 help = 'The buildbot archive to bisect [%s].' % |
600 '|'.join(choices)) | 604 '|'.join(choices)) |
601 parser.add_option('-o', action="store_true", dest='official_builds', | 605 parser.add_option('-o', action="store_true", dest='official_builds', |
602 help = 'Bisect across official ' + | 606 help = 'Bisect across official ' + |
603 'Chrome builds (internal only) instead of ' + | 607 'Chrome builds (internal only) instead of ' + |
604 'Chromium archives.') | 608 'Chromium archives.') |
605 parser.add_option('-b', '--bad', type = 'str', | 609 parser.add_option('-b', '--bad', type = 'str', |
606 help = 'The bad revision to bisect to. Default is HEAD.') | 610 help = 'A bad revision to start bisection. ' + |
611 'Default is HEAD.') | |
scheib
2013/01/04 22:41:09
I think we should be explicit even here, which is
Bei Zhang
2013/01/07 17:47:36
Done.
| |
607 parser.add_option('-g', '--good', type = 'str', | 612 parser.add_option('-g', '--good', type = 'str', |
608 help = 'The last known good revision to bisect from. ' + | 613 help = 'A good revision to start bisection. ' + |
609 'Default is 0.') | 614 'Default is 0.') |
610 parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', | 615 parser.add_option('-p', '--profile', '--user-data-dir', type = 'str', |
611 help = 'Profile to use; this will not reset every run. ' + | 616 help = 'Profile to use; this will not reset every run. ' + |
612 'Defaults to a clean profile.', default = 'profile') | 617 'Defaults to a clean profile.', default = 'profile') |
613 parser.add_option('-t', '--times', type = 'int', | 618 parser.add_option('-t', '--times', type = 'int', |
614 help = 'Number of times to run each build before asking ' + | 619 help = 'Number of times to run each build before asking ' + |
615 'if it\'s good or bad. Temporary profiles are reused.', | 620 'if it\'s good or bad. Temporary profiles are reused.', |
616 default = 1) | 621 default = 1) |
617 (opts, args) = parser.parse_args() | 622 (opts, args) = parser.parse_args() |
618 | 623 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
673 print 'WEBKIT CHANGELOG URL:' | 678 print 'WEBKIT CHANGELOG URL:' |
674 print ' ' + WEBKIT_CHANGELOG_URL % (max_webkit_rev, min_webkit_rev) | 679 print ' ' + WEBKIT_CHANGELOG_URL % (max_webkit_rev, min_webkit_rev) |
675 print 'CHANGELOG URL:' | 680 print 'CHANGELOG URL:' |
676 if opts.official_builds: | 681 if opts.official_builds: |
677 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 682 print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
678 else: | 683 else: |
679 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) | 684 print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
680 | 685 |
681 if __name__ == '__main__': | 686 if __name__ == '__main__': |
682 sys.exit(main()) | 687 sys.exit(main()) |
OLD | NEW |