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

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)
@@ -169,6 +169,7 @@
next-marker is not None, then the listing is a partial listing and another
fetch should be performed with next-marker being the marker= GET
parameter."""
+
Robert Sesek 2013/09/23 16:37:15 remove
kareng 2013/09/23 21:20:32 Done.
handle = urllib.urlopen(url)
document = ElementTree.parse(handle)
@@ -221,11 +222,33 @@
# 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()
- return revlist
+ # set good and bad revisions to be legit revisions
Robert Sesek 2013/09/23 16:37:15 Proper punctuation, capitalization, and grammar fo
kareng 2013/09/23 21:20:32 Done.
+ if revlist:
+ if (self.good_revision < self.bad_revision):
Robert Sesek 2013/09/23 16:37:15 nit: no () around conditions unless necessary for
kareng 2013/09/23 21:20:32 Done.
+ 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
Robert Sesek 2013/09/23 16:37:15 nit: same as above, but add a space after #
kareng 2013/09/23 21:20:32 Done.
+ if (self.base_url == WEBKIT_BASE_URL):
+ revlist_all.sort()
+ self.good_revision, revlist = FixChromiumRevForBlink(revlist,
+ revlist_all,
+ self,
+ self.good_revision)
+ self.bad_revision, revlist = FixChromiumRevForBlink(revlist,
+ revlist_all,
+ self,
+ self.bad_revision)
+ return revlist
Michael Moss 2013/09/20 21:10:12 You probably want to always return 'revlist' (i.e.
kareng 2013/09/23 21:20:32 yes that was a mistake of tabbing. ty!
+
def GetOfficialBuildsList(self):
"""Gets the list of official build numbers between self.good_revision and
self.bad_revision."""
@@ -608,10 +631,23 @@
return (revlist[minrev], revlist[maxrev])
+def GetBlinkDEPSREvisionForChromiumRevision(rev):
Robert Sesek 2013/09/23 16:37:15 Lowercase the E in Revision
kareng 2013/09/23 21:20:32 Done.
+ """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 cr rev %d' % rev)
Robert Sesek 2013/09/23 16:37:15 Capitalize Blink and spell out Chromium. This is a
kareng 2013/09/23 21:20:32 Done.
+
+
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,23 @@
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.
+ chromium revision |rev."""
Michael Moss 2013/09/20 21:10:12 Last line in the comment looks like copy-paste err
kareng 2013/09/23 21:20:32 Done.
+ blink_deps_rev = GetBlinkDEPSREvisionForChromiumRevision(rev)
+
+ while (GetBlinkRevisionForChromiumRevision(self, rev) > blink_deps_rev):
+ idx = revisions.index(rev)
+ rev = revisions[idx-1]
Michael Moss 2013/09/20 21:10:12 What happens if 'rev' is the first item in 'revisi
kareng 2013/09/23 21:20:32 heh good, point. i changed so now it doesn't conti
+ if rev not in revisions_final:
+ revisions_final.insert(0, rev)
+
+ revisions_final.sort()
+ return rev, revisions_final
Michael Moss 2013/09/20 21:10:12 It's probably worth noting that when you modify 'r
kareng 2013/09/23 21:20:32 so you think its better to copy and return the cop
Michael Moss 2013/09/23 22:01:56 Modifying in-place is fine with me, just make it e
+
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