Search in sources :

Example 1 with VcsBackgroundTask

use of com.intellij.util.ui.VcsBackgroundTask in project intellij-community by JetBrains.

the class HgVFSListener method performMoveRename.

@Override
protected void performMoveRename(List<MovedFileInfo> movedFiles) {
    (new VcsBackgroundTask<MovedFileInfo>(myProject, HgVcsMessages.message("hg4idea.move.progress"), VcsConfiguration.getInstance(myProject).getAddRemoveOption(), movedFiles) {

        protected void process(final MovedFileInfo file) throws VcsException {
            final FilePath source = VcsUtil.getFilePath(file.myOldPath);
            final FilePath target = VcsUtil.getFilePath(file.myNewPath);
            VirtualFile sourceRoot = VcsUtil.getVcsRootFor(myProject, source);
            VirtualFile targetRoot = VcsUtil.getVcsRootFor(myProject, target);
            if (sourceRoot != null && targetRoot != null) {
                (new HgMoveCommand(myProject)).execute(new HgFile(sourceRoot, source), new HgFile(targetRoot, target));
            }
            dirtyScopeManager.fileDirty(source);
            dirtyScopeManager.fileDirty(target);
        }
    }).queue();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsBackgroundTask(com.intellij.util.ui.VcsBackgroundTask)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 VcsBackgroundTask (com.intellij.util.ui.VcsBackgroundTask)1