parameters: (f, dest, deps)
docstring: Copy file or directory and update deps.
docstring_summary: Copy file or directory and update deps.
docstring_tokens: Copy file or directory and update deps .
function: def CopyFile(f, dest, deps):
    """Copy file or directory and update deps."""
    if os.path.isdir(f):
      shutil.copytree(f, os.path.join(dest, os.path.basename(f)))
      deps.extend(_get_all_files(f))
    else:
      if os.path.isfile(os.path.join(dest, os.path.basename(f))):
        dest = os.path.join(dest, os.path.basename(f))
  
      deps.append(f)
  
      if os.path.isfile(dest):
        if filecmp.cmp(dest, f, shallow=False):
          return
        # The shutil.copy() below would fail if the file does not have write
        # permissions. Deleting the file has similar costs to modifying the
        # permissions.
        os.unlink(dest)
  
      shutil.copy(f, dest)
function_tokens: def CopyFile ( f , dest , deps ) : if os . path . isdir ( f ) : shutil . copytree ( f , os . path . join ( dest , os . path . basename ( f ) ) ) deps . extend ( _get_all_files ( f ) ) else : if os . path . isfile ( os . path . join ( dest , os . path . basename ( f ) ) ) : dest = os . path . join ( dest , os . path . basename ( f ) ) deps . append ( f ) if os . path . isfile ( dest ) : if filecmp . cmp ( dest , f , shallow = False ) : return # The shutil.copy() below would fail if the file does not have write # permissions. Deleting the file has similar costs to modifying the # permissions. os . unlink ( dest ) shutil . copy ( f , dest )