Chromium Code Reviews| Index: tools/bisect-builds.py |
| diff --git a/tools/bisect-builds.py b/tools/bisect-builds.py |
| index de62779ad009d22dfbcdaa67544b1905f667a2c5..8718e87f9750695cf9cb15b8f0a10d6a31184dd7 100755 |
| --- a/tools/bisect-builds.py |
| +++ b/tools/bisect-builds.py |
| @@ -30,9 +30,13 @@ GOOGLE_APIS_URL = 'commondatastorage.googleapis.com' |
| OFFICIAL_BASE_URL = 'http://%s/%s' % (GOOGLE_APIS_URL, GS_BUCKET_NAME) |
| # URL template for viewing changelogs between revisions. |
| -CHANGELOG_URL = ('http://build.chromium.org' |
| - '/f/chromium/perf/dashboard/ui/changelog.html' |
| - '?url=/trunk/src&range=%d%%3A%d') |
| +CHANGELOG_URL = ('https://chromium.googlesource.com/chromium/src/+log/%s..%s') |
| + |
| +# URL to convert SVN revision to git hash. |
| +CRREV_URL = ('http://crrev.com/%s') |
|
DaleCurtis
2014/08/29 23:33:34
Hmm, this works, but is it the right way? Also for
pshenoy
2014/08/29 23:53:38
I'm not sure if there is any easy way to convert s
|
| + |
| +# Search pattern to match git hash. |
| +GITHASH_SEARCH_PATTERN = (r'<title>(\w+)\s') |
| # URL template for viewing changelogs between official versions. |
| OFFICIAL_CHANGELOG_URL = ('https://chromium.googlesource.com/chromium/' |
| @@ -944,6 +948,20 @@ def GetChromiumRevision(context, url): |
| print 'Could not determine latest revision. This could be bad...' |
| return 999999999 |
| +def PrintChangeLog(min_chromium_rev, max_chromium_rev): |
| + """Prints the changelog URL.""" |
| + def GetGitHashFromSVNRevision(svn_revision): |
| + crrev_url = CRREV_URL % str(svn_revision) |
| + url = urllib.urlopen(crrev_url) |
| + if url.getcode() == 200: |
| + search_pattern = re.compile(GITHASH_SEARCH_PATTERN) |
|
DaleCurtis
2014/08/29 23:33:34
No point in compiling here. Compile globally if yo
pshenoy
2014/08/29 23:53:38
Done.
|
| + result = search_pattern.search(url.read()) |
| + return result.group(1) |
| + return None |
|
DaleCurtis
2014/08/29 23:33:34
Automatically done, no need to write.
pshenoy
2014/08/29 23:53:38
Done.
|
| + |
| + print (' ' + CHANGELOG_URL % (GetGitHashFromSVNRevision(min_chromium_rev), |
| + GetGitHashFromSVNRevision(max_chromium_rev))) |
| + |
| def main(): |
| usage = ('%prog [options] [-- chromium-options]\n' |
| @@ -1147,7 +1165,7 @@ def main(): |
| if opts.official_builds: |
| print OFFICIAL_CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| else: |
| - print ' ' + CHANGELOG_URL % (min_chromium_rev, max_chromium_rev) |
| + PrintChangeLog(min_chromium_rev, max_chromium_rev) |
| if __name__ == '__main__': |