public void beforeFileMovement()

in src/net/sourceforge/transparent/VFSListener.java [181:204]


  public void beforeFileMovement(@NotNull VirtualFileMoveEvent event) {
    if (isIgnoredEvent(event)) {
      return;
    }

    VirtualFile file = event.getFile();
    String oldName = file.getPath();
    String newName = event.getNewParent().getPath() + "/" + file.getName();

    //  If the file is moved into Vss-versioned module, then it is a simple
    //  movement. Otherwise (move into non-versioned module), mark it
    //  "for removal" in the current, versioned module.
    if (VcsUtil.isFileForVcs(newName, project, host) && isExistingVersioned(file) && isVersioned(event.getNewParent())) {
      storeRenameOrMoveInfo(file.isDirectory() ? host.renamedFolders : host.renamedFiles, oldName, newName);

      //  Clear the cache of the content revisions for this file.
      //  This will make possible to reread the correct version content
      //  after the referred FilePath/VirtualFile is changed
      ContentRevisionFactory.clearCacheForFile(file.getPath());
    }
    else {
      performDeleteFile(file);
    }
  }