| Index: tools/bisect-builds.py
|
| ===================================================================
|
| --- tools/bisect-builds.py (revision 223632)
|
| +++ tools/bisect-builds.py (working copy)
|
| @@ -221,9 +221,31 @@
|
| # Download the revlist and filter for just the range between good and bad.
|
| minrev = min(self.good_revision, self.bad_revision)
|
| maxrev = max(self.good_revision, self.bad_revision)
|
| - revlist = map(int, self.ParseDirectoryIndex())
|
| - revlist = [x for x in revlist if x >= int(minrev) and x <= int(maxrev)]
|
| + revlist_all = map(int, self.ParseDirectoryIndex())
|
| +
|
| + revlist = [x for x in revlist_all if x >= int(minrev) and x <= int(maxrev)]
|
| revlist.sort()
|
| +
|
| + # Set good and bad revisions to be legit revisions.
|
| + if revlist:
|
| + if self.good_revision < self.bad_revision:
|
| + self.good_revision = revlist[0]
|
| + self.bad_revision = revlist[-1]
|
| + else:
|
| + self.bad_revision = revlist[0]
|
| + self.good_revision = revlist[-1]
|
| +
|
| + # Fix chromium rev so that the deps blink revision matches REVISIONS file.
|
| + if self.base_url == WEBKIT_BASE_URL:
|
| + revlist_all.sort()
|
| + self.good_revision = FixChromiumRevForBlink(revlist,
|
| + revlist_all,
|
| + self,
|
| + self.good_revision)
|
| + self.bad_revision = FixChromiumRevForBlink(revlist,
|
| + revlist_all,
|
| + self,
|
| + self.bad_revision)
|
| return revlist
|
|
|
| def GetOfficialBuildsList(self):
|
| @@ -608,10 +630,24 @@
|
| return (revlist[minrev], revlist[maxrev])
|
|
|
|
|
| +def GetBlinkDEPSRevisionForChromiumRevision(rev):
|
| + """Returns the blink revision that was in REVISIONS file at
|
| + chromium revision |rev|."""
|
| + # . doesn't match newlines without re.DOTALL, so this is safe.
|
| + blink_re = re.compile(r'webkit_revision\D*(\d+)')
|
| + url = urllib.urlopen(DEPS_FILE % rev)
|
| + m = blink_re.search(url.read())
|
| + url.close()
|
| + if m:
|
| + return int(m.group(1))
|
| + else:
|
| + raise Exception('Could not get Blink revision for Chromium rev %d'
|
| + % rev)
|
| +
|
| +
|
| def GetBlinkRevisionForChromiumRevision(self, rev):
|
| """Returns the blink revision that was in REVISIONS file at
|
| chromium revision |rev|."""
|
| - # . doesn't match newlines without re.DOTALL, so this is safe.
|
| file_url = "%s/%s%d/REVISIONS" % (self.base_url,
|
| self._listing_platform_dir, rev)
|
| url = urllib.urlopen(file_url)
|
| @@ -622,7 +658,25 @@
|
| else:
|
| raise Exception('Could not get blink revision for cr rev %d' % rev)
|
|
|
| +def FixChromiumRevForBlink(revisions_final, revisions, self, rev):
|
| + """Returns the chromium revision that has the correct blink revision
|
| + for blink bisect, DEPS and REVISIONS file might not match since
|
| + blink snapshots point to tip of tree blink.
|
| + Note: The revisions_final variable might get modified to include
|
| + additional revisions."""
|
|
|
| + blink_deps_rev = GetBlinkDEPSRevisionForChromiumRevision(rev)
|
| +
|
| + while (GetBlinkRevisionForChromiumRevision(self, rev) > blink_deps_rev):
|
| + idx = revisions.index(rev)
|
| + if idx > 0:
|
| + rev = revisions[idx-1]
|
| + if rev not in revisions_final:
|
| + revisions_final.insert(0, rev)
|
| +
|
| + revisions_final.sort()
|
| + return rev
|
| +
|
| def GetChromiumRevision(url):
|
| """Returns the chromium revision read from given URL."""
|
| try:
|
|
|