native_client_sdk/src/build_tools/build_version.py
def FetchCommitPosition(directory=None):
  '''Return the "commit-position" of the Chromium git repo. This should be
  equivalent to the SVN revision if one exists.
  '''
  SEARCH_LIMIT = 100
  for i in xrange(SEARCH_LIMIT):
    cmd = ['show', '-s', '--format=%H%n%B', 'HEAD~%d' % i]
    proc = lastchange.RunGitCommand(directory, cmd)
    if not proc:
      break

    output = proc.communicate()[0]
    if not (proc.returncode == 0 and output):
      break

    lines = output.splitlines()

    # First line is the hash.
    hsh = lines[0]
    if not re.match(r'[0-9a-fA-F]+', hsh):
      break

    for line in reversed(lines):
      if line.startswith('Cr-Commit-Position:'):
        pos = line.rsplit()[-1].strip()
        return lastchange.VersionInfo(hsh, '%s-%s' % (hsh, pos))

  raise Exception('Unable to fetch a Git Commit Position.')
Return the "commit-position" of the Chromium git repo. This should be
  equivalent to the SVN revision if one exists.
  
Return the "commit-position" of the Chromium git repo. This should be
equivalent to the SVN revision if one exists.
Return the " commit - position " of the Chromium git repo . This should be equivalent to the SVN revision if one exists .
def FetchCommitPosition(directory=None):
  SEARCH_LIMIT = 100
  for i in xrange(SEARCH_LIMIT):
    cmd = ['show', '-s', '--format=%H%n%B', 'HEAD~%d' % i]
    proc = lastchange.RunGitCommand(directory, cmd)
    if not proc:
      break
    output = proc.communicate()[0]
    if not (proc.returncode == 0 and output):
      break
    lines = output.splitlines()
    hsh = lines[0]
    if not re.match(r'[0-9a-fA-F]+', hsh):
      break
    for line in reversed(lines):
      if line.startswith('Cr-Commit-Position:'):
        pos = line.rsplit()[-1].strip()
        return lastchange.VersionInfo(hsh, '%s-%s' % (hsh, pos))
  raise Exception('Unable to fetch a Git Commit Position.')
def FetchCommitPosition ( directory = None ) : SEARCH_LIMIT = 100 for i in xrange ( SEARCH_LIMIT ) : cmd = [ 'show' , '-s' , '--format=%H%n%B' , 'HEAD~%d' % i ] proc = lastchange . RunGitCommand ( directory , cmd ) if not proc : break output = proc . communicate ( ) [ 0 ] if not ( proc . returncode == 0 and output ) : break lines = output . splitlines ( ) hsh = lines [ 0 ] if not re . match ( r'[0-9a-fA-F]+' , hsh ) : break for line in reversed ( lines ) : if line . startswith ( 'Cr-Commit-Position:' ) : pos = line . rsplit ( ) [ - 1 ] . strip ( ) return lastchange . VersionInfo ( hsh , '%s-%s' % ( hsh , pos ) ) raise Exception ( 'Unable to fetch a Git Commit Position.' )
Return the "commit-position" of the Chromium git repo.
Return the " commit - position " of the Chromium git repo .
'''Return the "commit-position" of the Chromium git repo. This should be
  equivalent to the SVN revision if one exists.
  ''' # First line is the hash.
directory