public boolean fileExistsInVcs()

in src/net/sourceforge/transparent/TransparentVcs.java [347:380]


  public boolean fileExistsInVcs(FilePath path )
  {
    //  In the case we are offline, reply "NO" since we can not say definitely
    //  anything on the file status (and must not issue any CCase cleartool
    //  command).
    if( config.isOffline() )
      return false;

    VirtualFile vfile = path.getVirtualFile();
    if( vfile != null )
    {
      //  Non-obvious optimization:
      //  - if the file already has status "MODIFIED" or "HIJACKED", it means
      //    that it is already under this vcs (since we managed to determine its
      //    correct status);
      //  - Otherwise it would have the status "NEW" or "UNVERSIONED" or (as in the case
      //    read-only files) have no status at all.

      FileStatus status = FileStatusManager.getInstance(myProject).getStatus( vfile );
      if( status == FileStatus.MODIFIED || status == FileStatus.HIJACKED || FileStatus.NOT_CHANGED == status)
        return true;
      else
      if( status == FileStatus.UNKNOWN || status == FileStatus.ADDED )
        return false;
      else
        return fileExistsInVcs( path.getPath() );
    }
    else
    {
      //  Probably the file which was removed from the project (e.g. as the
      //  result of UpdateProject command).
      return fileExistsInVcs( path.getPath() );
    }
  }