| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 progress = "Received %d of %d bytes, %.2f%%" % ( | 229 progress = "Received %d of %d bytes, %.2f%%" % ( |
| 230 size, totalsize, 100.0 * size / totalsize) | 230 size, totalsize, 100.0 * size / totalsize) |
| 231 # Send a \r to let all progress messages use just one line of output. | 231 # Send a \r to let all progress messages use just one line of output. |
| 232 sys.stdout.write("\r" + progress) | 232 sys.stdout.write("\r" + progress) |
| 233 sys.stdout.flush() | 233 sys.stdout.flush() |
| 234 | 234 |
| 235 download_url = context.GetDownloadURL(rev) | 235 download_url = context.GetDownloadURL(rev) |
| 236 try: | 236 try: |
| 237 urllib.urlretrieve(download_url, filename, ReportHook) | 237 urllib.urlretrieve(download_url, filename, ReportHook) |
| 238 if progress_event and progress_event.isSet(): | 238 if progress_event and progress_event.isSet(): |
| 239 print() | 239 print |
| 240 except RuntimeError, e: | 240 except RuntimeError, e: |
| 241 pass | 241 pass |
| 242 | 242 |
| 243 | 243 |
| 244 def RunRevision(context, revision, zipfile, profile, args): | 244 def RunRevision(context, revision, zipfile, profile, args): |
| 245 """Given a zipped revision, unzip it and run the test.""" | 245 """Given a zipped revision, unzip it and run the test.""" |
| 246 print "Trying revision %d..." % revision | 246 print "Trying revision %d..." % revision |
| 247 | 247 |
| 248 # Create a temp directory and unzip the revision into it. | 248 # Create a temp directory and unzip the revision into it. |
| 249 cwd = os.getcwd() | 249 cwd = os.getcwd() |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 print 'WEBKIT CHANGELOG URL:' | 529 print 'WEBKIT CHANGELOG URL:' |
| 530 print WEBKIT_CHANGELOG_URL % (first_known_bad_webkit_rev, | 530 print WEBKIT_CHANGELOG_URL % (first_known_bad_webkit_rev, |
| 531 last_known_good_webkit_rev) | 531 last_known_good_webkit_rev) |
| 532 print 'CHANGELOG URL:' | 532 print 'CHANGELOG URL:' |
| 533 print CHANGELOG_URL % (last_known_good_rev, first_known_bad_rev) | 533 print CHANGELOG_URL % (last_known_good_rev, first_known_bad_rev) |
| 534 print 'Built at revision:' | 534 print 'Built at revision:' |
| 535 print BUILD_VIEWVC_URL % first_known_bad_rev | 535 print BUILD_VIEWVC_URL % first_known_bad_rev |
| 536 | 536 |
| 537 if __name__ == '__main__': | 537 if __name__ == '__main__': |
| 538 sys.exit(main()) | 538 sys.exit(main()) |
| OLD | NEW |