tools/bisect-builds.py
def GetBlinkRevisionForChromiumRevision(context, rev):
  """Returns the blink revision that was in REVISIONS file at
  chromium revision |rev|."""
  def _IsRevisionNumber(revision):
    if isinstance(revision, int):
      return True
    else:
      return revision.isdigit()
  if str(rev) in context.githash_svn_dict:
    rev = context.githash_svn_dict[str(rev)]
  file_url = '%s/%s%s/REVISIONS' % (context.base_url,
                                    context._listing_platform_dir, rev)
  url = urllib.urlopen(file_url)
  if url.getcode() == 200:
    try:
      data = json.loads(url.read())
    except ValueError:
      print('ValueError for JSON URL: %s' % file_url)
      raise ValueError
  else:
    raise ValueError
  url.close()
  if 'webkit_revision' in data:
    blink_rev = data['webkit_revision']
    if not _IsRevisionNumber(blink_rev):
      blink_rev = int(context.GetSVNRevisionFromGitHash(blink_rev, 'blink'))
    return blink_rev
  else:
    raise Exception('Could not get blink revision for cr rev %d' % rev)
Returns the blink revision that was in REVISIONS file at
  chromium revision |rev|.
Returns the blink revision that was in REVISIONS file at
chromium revision |rev|.
Returns the blink revision that was in REVISIONS file at chromium revision |rev| .
def GetBlinkRevisionForChromiumRevision(context, rev):
  def _IsRevisionNumber(revision):
    if isinstance(revision, int):
      return True
    else:
      return revision.isdigit()
  if str(rev) in context.githash_svn_dict:
    rev = context.githash_svn_dict[str(rev)]
  file_url = '%s/%s%s/REVISIONS' % (context.base_url,
                                    context._listing_platform_dir, rev)
  url = urllib.urlopen(file_url)
  if url.getcode() == 200:
    try:
      data = json.loads(url.read())
    except ValueError:
      print('ValueError for JSON URL: %s' % file_url)
      raise ValueError
  else:
    raise ValueError
  url.close()
  if 'webkit_revision' in data:
    blink_rev = data['webkit_revision']
    if not _IsRevisionNumber(blink_rev):
      blink_rev = int(context.GetSVNRevisionFromGitHash(blink_rev, 'blink'))
    return blink_rev
  else:
    raise Exception('Could not get blink revision for cr rev %d' % rev)
def GetBlinkRevisionForChromiumRevision ( context , rev ) : def _IsRevisionNumber ( revision ) : if isinstance ( revision , int ) : return True else : return revision . isdigit ( ) if str ( rev ) in context . githash_svn_dict : rev = context . githash_svn_dict [ str ( rev ) ] file_url = '%s/%s%s/REVISIONS' % ( context . base_url , context . _listing_platform_dir , rev ) url = urllib . urlopen ( file_url ) if url . getcode ( ) == 200 : try : data = json . loads ( url . read ( ) ) except ValueError : print ( 'ValueError for JSON URL: %s' % file_url ) raise ValueError else : raise ValueError url . close ( ) if 'webkit_revision' in data : blink_rev = data [ 'webkit_revision' ] if not _IsRevisionNumber ( blink_rev ) : blink_rev = int ( context . GetSVNRevisionFromGitHash ( blink_rev , 'blink' ) ) return blink_rev else : raise Exception ( 'Could not get blink revision for cr rev %d' % rev )
Returns the blink revision that was in REVISIONS file at
chromium revision |rev|.
Returns the blink revision that was in REVISIONS file at chromium revision |rev| .
"""Returns the blink revision that was in REVISIONS file at
  chromium revision |rev|."""
context
rev