tools/bisect-builds.py
def GetRevision(revision_text):
  """Translates from a text description of a revision to an integral revision
  number. Currently supported formats are a number (i.e.; '782793') or a
  milestone specifier (i.e.; 'M85') or a full version string
  (i.e. '85.0.4183.121')."""

  # Check if we already have a revision number, such as when -g or -b is
  # omitted.
  if type(revision_text) == type(0):
    return revision_text

  # Translate from stable milestone name to the latest version number released
  # for that milestone, i.e.; 'M85' to '85.0.4183.121'.
  if revision_text[:1].upper() == 'M':
    milestone = revision_text[1:]
    response = urllib.urlopen(VERSION_HISTORY_URL)
    version_history = json.loads(response.read())
    version_matcher = re.compile(
        '.*versions/(\d*)\.(\d*)\.(\d*)\.(\d*)/releases.*')
    for version in version_history['releases']:
      match = version_matcher.match(version['name'])
      # There will be multiple versions of each milestone, but we just grab the
      # first one that we see which will be the most recent version. If you need
      # more granularity then specify a full version number or revision number.
      if match and match.groups()[0] == milestone:
        revision_text = '.'.join(match.groups())
        break
    if revision_text[:1].upper() == 'M':
      raise Exception('No stable release matching %s found.' % revision_text)

  # Translate from version number to commit position, also known as revision
  # number.
  if len(revision_text.split('.')) == 4:
    response = urllib.urlopen(OMAHA_REVISIONS_URL % revision_text)
    revision_details = json.loads(response.read())
    revision_text = revision_details['chromium_base_position']

  # Translate from text commit position to integer commit position.
  return int(revision_text)
Translates from a text description of a revision to an integral revision
  number. Currently supported formats are a number (i.e.; '782793') or a
  milestone specifier (i.e.; 'M85') or a full version string
  (i.e. '85.0.4183.121').
Translates from a text description of a revision to an integral revision
number. Currently supported formats are a number  or a
milestone specifier  or a full version string
.
Translates from a text description of a revision to an integral revision number . Currently supported formats are a number or a milestone specifier or a full version string .
def GetRevision(revision_text):
  if type(revision_text) == type(0):
    return revision_text
  if revision_text[:1].upper() == 'M':
    milestone = revision_text[1:]
    response = urllib.urlopen(VERSION_HISTORY_URL)
    version_history = json.loads(response.read())
    version_matcher = re.compile(
        '.*versions/(\d*)\.(\d*)\.(\d*)\.(\d*)/releases.*')
    for version in version_history['releases']:
      match = version_matcher.match(version['name'])
      if match and match.groups()[0] == milestone:
        revision_text = '.'.join(match.groups())
        break
    if revision_text[:1].upper() == 'M':
      raise Exception('No stable release matching %s found.' % revision_text)
  if len(revision_text.split('.')) == 4:
    response = urllib.urlopen(OMAHA_REVISIONS_URL % revision_text)
    revision_details = json.loads(response.read())
    revision_text = revision_details['chromium_base_position']
  return int(revision_text)
def GetRevision ( revision_text ) : if type ( revision_text ) == type ( 0 ) : return revision_text if revision_text [ : 1 ] . upper ( ) == 'M' : milestone = revision_text [ 1 : ] response = urllib . urlopen ( VERSION_HISTORY_URL ) version_history = json . loads ( response . read ( ) ) version_matcher = re . compile ( '.*versions/(\d*)\.(\d*)\.(\d*)\.(\d*)/releases.*' ) for version in version_history [ 'releases' ] : match = version_matcher . match ( version [ 'name' ] ) if match and match . groups ( ) [ 0 ] == milestone : revision_text = '.' . join ( match . groups ( ) ) break if revision_text [ : 1 ] . upper ( ) == 'M' : raise Exception ( 'No stable release matching %s found.' % revision_text ) if len ( revision_text . split ( '.' ) ) == 4 : response = urllib . urlopen ( OMAHA_REVISIONS_URL % revision_text ) revision_details = json . loads ( response . read ( ) ) revision_text = revision_details [ 'chromium_base_position' ] return int ( revision_text )
Translates from a text description of a revision to an integral revision
number.
Translates from a text description of a revision to an integral revision number .
"""Translates from a text description of a revision to an integral revision
  number. Currently supported formats are a number (i.e.; '782793') or a
  milestone specifier (i.e.; 'M85') or a full version string
  (i.e. '85.0.4183.121').""" # Check if we already have a revision number, such as when -g or -b is # omitted. # Translate from stable milestone name to the latest version number released # for that milestone, i.e.; 'M85' to '85.0.4183.121'. # There will be multiple versions of each milestone, but we just grab the # first one that we see which will be the most recent version. If you need # more granularity then specify a full version number or revision number. # Translate from version number to commit position, also known as revision # number. # Translate from text commit position to integer commit position.
revision_text