public void moveRenameAndCheckInFile()

in src/net/sourceforge/transparent/TransparentVcs.java [737:792]


  public void moveRenameAndCheckInFile( String filePath, String newParentPath, String newName,
                                       String comment, final List<VcsException> errors )
  {
    final File oldFile = new File( filePath );
    final File newFile = new File( newParentPath, newName );

    try
    {
      @NonNls final String modComment = StringUtil.isEmpty(comment) ? "Moved " + filePath + " to " + newName : comment;

      Runnable action = () -> {
        renameFile( newFile, oldFile );
        if( !oldFile.isDirectory() )
        {
          checkinFile( oldFile, modComment, errors );
        }

        //  Continue transaction only if there was no error on the previous
        //  step.
        if( errors.size() == 0 )
        {
          VcsException error;
          try
          {
            error = tryToCheckout( newFile.getParentFile(), modComment, false);
            if( error != null )
              throw error;
            error = tryToCheckout( oldFile.getParentFile(), modComment, false);
            if( error != null )
              throw error;

            getClearCase().move( oldFile, newFile, modComment );

            checkinFile( newFile.getParentFile(), null, errors );
            checkinFile( oldFile.getParentFile(), null, errors );
          }
          catch( VcsException e )
          {
            handleException( e, newFile, errors );
          }
        }
      };

      executeAndHandleOtherFileInTheWay( oldFile, action );
      //  In the case when everything went to the hell, just keep stuff on
      //  its own place.
      if( errors.size() > 0 )
      {
        renameFile( oldFile, newFile );
      }
    }
    catch( Throwable e )
    {
      handleException( e, newFile, errors );
    }
  }