private void rollbackMissingFileDeletion()

in src/net/sourceforge/transparent/Checkin/CCaseRollbackEnvironment.java [236:280]


  private void rollbackMissingFileDeletion( FilePath path, List<VcsException> errors )
  {
    VcsDirtyScopeManager mgr = VcsDirtyScopeManager.getInstance( project );

    String normPath = VcsUtil.getCanonicalLocalPath( path.getPath() );
    if( host.isFolderRemoved( normPath ) || host.isFolderRemovedForVcs( normPath ) )
    {
      //  For ClearCase to get back the locally removed folder, it is
      //  necessary to issue "Update" command. This will revert it to the
      //  state before the checking out on deletion.
      updateFile( path.getPath(), errors );

      //  In the case we restoring the folder which IS NOT in the repository
      //  (e.g. it was inproperly put into the list of deleted or it was already
      //  removed from the VOB), it is not restored locally and no update is
      //  needed. BUT: since it is not created, its record in the hash of removed
      //  folders is not removed too - thus remove it explicitely here.
      if( path.getIOFile().exists() )
      {
        //  If that folder contained checked out files, then they are not
        //  reverted back after the parent folder is updated. For each of
        //  file we need to issue "undocheckout" command.
        undocheckoutInFolder( path.getPath(), errors );
      }
      else
      {
        host.removeFolderFromDeleted( normPath );
      }
    }
    else
    {
      //  For ClearCase to get back the locally removed file:
      //  1. Issue "Undo Checkout" command. This will revert it to the state
      //     before its checkout on deletion (if it was checked out previously).
      //  2. Otherwise (we rollback the file which was not previusly checked
      //     out) perform "Update".
      List<VcsException> localErrors = new ArrayList<>();
      host.undoCheckoutFile( path.getIOFile(), localErrors );
      if( localErrors.size() > 0 )
      {
        updateFile( path.getPath(), errors );
      }
    }
    mgr.fileDirty( path );
  }