Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: tools/bisect-builds.py

Issue 23629048: Changed script to pickup right chromium revision regardless of what's passed in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 VERSIONS 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
Robert Sesek 2013/09/24 22:08:32 Capitalize DEPS and is it REVISIONS or VERSIONS (w
+ 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698