parameters: (deps, manifest)
docstring: Convert the |deps| file to the |manifest|.
docstring_summary: Convert the |deps| file to the |manifest|.
docstring_tokens: Convert the |deps| file to the |manifest| .
function: def ConvertDepsToManifest(deps, manifest):
    """Convert the |deps| file to the |manifest|."""
    # Load the DEPS file data.
    ctx = {}
    execfile(deps, ctx)
  
    new_contents = ''
  
    # Write out the common header.
    data = {
        'prog': os.path.basename(__file__),
    }
    new_contents += MANIFEST_HEAD % data
  
    # Write out the <remote> sections.
    for name, fetch in REMOTES.items():
      data = {
          'name': name,
          'fetch': fetch,
          'review': REVIEWS.get(name, ''),
      }
      new_contents += MANIFEST_REMOTE % data
  
    # Write out the main repo itself.
    data = {
        'path': 'src',
        'name': 'breakpad/breakpad',
        'revision': 'refs/heads/master',
        'remote': 'chromium',
    }
    new_contents += MANIFEST_PROJECT % data
  
    # Write out the <project> sections.
    for path, url in ctx['deps'].items():
      for name, fetch in REMOTES.items():
        if url.startswith(fetch):
          remote = name
          break
      else:
        raise ValueError('Unknown DEPS remote: %s: %s' % (path, url))
  
      # The DEPS url will look like:
      # https://chromium.googlesource.com/external/gyp/@e8ab0833a42691cd2
      remote_path, rev = url.split('@')
      remote_path = remote_path[len(fetch):]
  
      # If it's not a revision, assume it's a tag.  Repo wants full ref names.
      if len(rev) != 40:
        rev = 'refs/tags/%s' % rev
  
      data = {
          'path': path,
          'name': remote_path,
          'revision': rev,
          'remote': remote,
      }
      new_contents += MANIFEST_PROJECT % data
  
    # Write out the common footer.
    new_contents += MANIFEST_TAIL
  
    # See if the manifest has actually changed contents to avoid thrashing.
    try:
      old_contents = open(manifest).read()
    except IOError:
      # In case the file doesn't exist yet.
      old_contents = ''
    if old_contents != new_contents:
      print('Updating %s due to changed %s' % (manifest, deps))
      with open(manifest, 'w') as fp:
        fp.write(new_contents)
function_tokens: def ConvertDepsToManifest ( deps , manifest ) : # Load the DEPS file data. ctx = { } execfile ( deps , ctx ) new_contents = '' # Write out the common header. data = { 'prog' : os . path . basename ( __file__ ) , } new_contents += MANIFEST_HEAD % data # Write out the <remote> sections. for name , fetch in REMOTES . items ( ) : data = { 'name' : name , 'fetch' : fetch , 'review' : REVIEWS . get ( name , '' ) , } new_contents += MANIFEST_REMOTE % data # Write out the main repo itself. data = { 'path' : 'src' , 'name' : 'breakpad/breakpad' , 'revision' : 'refs/heads/master' , 'remote' : 'chromium' , } new_contents += MANIFEST_PROJECT % data # Write out the <project> sections. for path , url in ctx [ 'deps' ] . items ( ) : for name , fetch in REMOTES . items ( ) : if url . startswith ( fetch ) : remote = name break else : raise ValueError ( 'Unknown DEPS remote: %s: %s' % ( path , url ) ) # The DEPS url will look like: # https://chromium.googlesource.com/external/gyp/@e8ab0833a42691cd2 remote_path , rev = url . split ( '@' ) remote_path = remote_path [ len ( fetch ) : ] # If it's not a revision, assume it's a tag.  Repo wants full ref names. if len ( rev ) != 40 : rev = 'refs/tags/%s' % rev data = { 'path' : path , 'name' : remote_path , 'revision' : rev , 'remote' : remote , } new_contents += MANIFEST_PROJECT % data # Write out the common footer. new_contents += MANIFEST_TAIL # See if the manifest has actually changed contents to avoid thrashing. try : old_contents = open ( manifest ) . read ( ) except IOError : # In case the file doesn't exist yet. old_contents = '' if old_contents != new_contents : print ( 'Updating %s due to changed %s' % ( manifest , deps ) ) with open ( manifest , 'w' ) as fp : fp . write ( new_contents )