diff options
author | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-24 23:49:30 +0000 |
---|---|---|
committer | karen@chromium.org <karen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-24 23:49:30 +0000 |
commit | 37ed317e9c41e1251cdbb2661ba2bd41d4a9d8a8 (patch) | |
tree | 801986549b82c55345ee2ae8dda9cc1ece390a50 /tools/bisect-builds.py | |
parent | 8e1da7e80df16a04dfacad1cc69b705b91117a4a (diff) | |
download | chromium_src-37ed317e9c41e1251cdbb2661ba2bd41d4a9d8a8.zip chromium_src-37ed317e9c41e1251cdbb2661ba2bd41d4a9d8a8.tar.gz chromium_src-37ed317e9c41e1251cdbb2661ba2bd41d4a9d8a8.tar.bz2 |
Changed script to pickup right chromium revision regardless of what's passed in
so that the blink revision in DEPS matches the one in VERSIONS.
Also fixed good and bad versions to point to actual builds to make sure VERSIONS
file exists and can be read.
R=mmoss@chromium.org, rsesek@chromium.org
Review URL: https://codereview.chromium.org/23629048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225102 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/bisect-builds.py')
-rwxr-xr-x | tools/bisect-builds.py | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/tools/bisect-builds.py b/tools/bisect-builds.py index 2ab9dc3..75afbf9 100755 --- a/tools/bisect-builds.py +++ b/tools/bisect-builds.py @@ -221,9 +221,31 @@ class PathContext(object): # 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 @@ def Bisect(base_url, return (revlist[minrev], revlist[maxrev]) -def GetBlinkRevisionForChromiumRevision(self, rev): +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|.""" file_url = "%s/%s%d/REVISIONS" % (self.base_url, self._listing_platform_dir, rev) url = urllib.urlopen(file_url) @@ -622,6 +658,24 @@ def GetBlinkRevisionForChromiumRevision(self, rev): 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.""" |