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, |
11 unzipping, and opening Chromium for you. After testing the specific revision, | 11 unzipping, and opening Chromium for you. After testing the specific revision, |
12 it will ask you whether it is good or bad before continuing the search. | 12 it will ask you whether it is good or bad before continuing the search. |
13 """ | 13 """ |
14 | 14 |
15 # The root URL for storage. | 15 # The root URL for storage. |
16 BASE_URL = 'http://commondatastorage.googleapis.com/chromium-browser-snapshots' | 16 BASE_URL = 'http://commondatastorage.googleapis.com/chromium-browser-snapshots' |
17 | 17 |
18 # URL to the ViewVC commit page. | |
19 BUILD_VIEWVC_URL = 'http://src.chromium.org/viewvc/chrome?view=rev&revision=%d' | |
20 | |
21 # Changelogs URL. | 18 # Changelogs URL. |
22 CHANGELOG_URL = 'http://build.chromium.org/f/chromium/' \ | 19 CHANGELOG_URL = 'http://build.chromium.org/f/chromium/' \ |
23 'perf/dashboard/ui/changelog.html?url=/trunk/src&range=%d:%d' | 20 'perf/dashboard/ui/changelog.html?url=/trunk/src&range=%d:%d' |
24 | 21 |
25 # DEPS file URL. | 22 # DEPS file URL. |
26 DEPS_FILE= 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d' | 23 DEPS_FILE= 'http://src.chromium.org/viewvc/chrome/trunk/src/DEPS?revision=%d' |
27 | 24 |
28 # WebKit Changelogs URL. | 25 # WebKit Changelogs URL. |
29 WEBKIT_CHANGELOG_URL = 'http://trac.webkit.org/log/' \ | 26 WEBKIT_CHANGELOG_URL = 'http://trac.webkit.org/log/' \ |
30 'trunk/?rev=%d&stop_rev=%d&verbose=on' | 27 'trunk/?rev=%d&stop_rev=%d&verbose=on' |
31 | 28 |
| 29 DONE_MESSAGE = 'You are probably looking for a change made after ' \ |
| 30 '%d (known good), but no later than %d (first known bad).' |
| 31 |
32 ############################################################################### | 32 ############################################################################### |
33 | 33 |
34 import math | 34 import math |
35 import optparse | 35 import optparse |
36 import os | 36 import os |
37 import pipes | 37 import pipes |
38 import re | 38 import re |
39 import shutil | 39 import shutil |
40 import subprocess | 40 import subprocess |
41 import sys | 41 import sys |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 try: | 535 try: |
536 last_known_good_webkit_rev = GetWebKitRevisionForChromiumRevision( | 536 last_known_good_webkit_rev = GetWebKitRevisionForChromiumRevision( |
537 last_known_good_rev) | 537 last_known_good_rev) |
538 first_known_bad_webkit_rev = GetWebKitRevisionForChromiumRevision( | 538 first_known_bad_webkit_rev = GetWebKitRevisionForChromiumRevision( |
539 first_known_bad_rev) | 539 first_known_bad_rev) |
540 except Exception, e: | 540 except Exception, e: |
541 # Silently ignore the failure. | 541 # Silently ignore the failure. |
542 last_known_good_webkit_rev, first_known_bad_webkit_rev = 0, 0 | 542 last_known_good_webkit_rev, first_known_bad_webkit_rev = 0, 0 |
543 | 543 |
544 # We're done. Let the user know the results in an official manner. | 544 # We're done. Let the user know the results in an official manner. |
545 print('You are probably looking for build %d.' % first_known_bad_rev) | 545 print DONE_MESSAGE % (last_known_good_rev, first_known_bad_rev) |
| 546 print 'CHANGELOG URL:' |
| 547 print ' ' + CHANGELOG_URL % (last_known_good_rev, first_known_bad_rev) |
546 if last_known_good_webkit_rev != first_known_bad_webkit_rev: | 548 if last_known_good_webkit_rev != first_known_bad_webkit_rev: |
547 print 'WEBKIT CHANGELOG URL:' | 549 print 'WEBKIT CHANGELOG URL:' |
548 print WEBKIT_CHANGELOG_URL % (first_known_bad_webkit_rev, | 550 print ' ' + WEBKIT_CHANGELOG_URL % (first_known_bad_webkit_rev, |
549 last_known_good_webkit_rev) | 551 last_known_good_webkit_rev) |
550 print 'CHANGELOG URL:' | |
551 print CHANGELOG_URL % (last_known_good_rev, first_known_bad_rev) | |
552 print 'Built at revision:' | |
553 print BUILD_VIEWVC_URL % first_known_bad_rev | |
554 | |
555 | 552 |
556 if __name__ == '__main__': | 553 if __name__ == '__main__': |
557 sys.exit(main()) | 554 sys.exit(main()) |
OLD | NEW |