Search in sources :

Example 1 with SvnProgressCanceller

use of org.jetbrains.idea.svn.SvnProgressCanceller in project intellij-community by JetBrains.

the class CleanupWorker method run.

@Override
public void run(@NotNull ProgressIndicator indicator) {
    indicator.setIndeterminate(true);
    for (VirtualFile root : myRoots) {
        try {
            File path = virtualToIoFile(root);
            File pathOrParent = virtualToIoFile(root.isDirectory() ? root : root.getParent());
            indicator.setText(message("action.Subversion.cleanup.progress.text", path));
            myVcs.getFactory(path).createCleanupClient().cleanup(pathOrParent, new SvnProgressCanceller(indicator));
        } catch (VcsException e) {
            myExceptions.add(Pair.create(e, root));
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsException(com.intellij.openapi.vcs.VcsException) SvnProgressCanceller(org.jetbrains.idea.svn.SvnProgressCanceller) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)

Example 2 with SvnProgressCanceller

use of org.jetbrains.idea.svn.SvnProgressCanceller in project intellij-community by JetBrains.

the class CreateExternalAction method doInBackground.

private static void doInBackground(@NotNull Project project, @NotNull VirtualFile file, String url, boolean checkout, String target) {
    SvnVcs vcs = SvnVcs.getInstance(project);
    VcsDirtyScopeManager dirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
    File ioFile = virtualToIoFile(file);
    try {
        addToExternalProperty(vcs, ioFile, target, url);
        dirtyScopeManager.fileDirty(file);
        if (checkout) {
            UpdateClient client = vcs.getFactory(ioFile).createUpdateClient();
            client.setEventHandler(new SvnProgressCanceller());
            client.doUpdate(ioFile, SVNRevision.HEAD, Depth.UNKNOWN, false, false);
            file.refresh(true, true, () -> dirtyScopeManager.dirDirtyRecursively(file));
        }
    } catch (VcsException e) {
        AbstractVcsHelper.getInstance(project).showError(e, "Create External");
    }
}
Also used : UpdateClient(org.jetbrains.idea.svn.update.UpdateClient) SvnProgressCanceller(org.jetbrains.idea.svn.SvnProgressCanceller) ChangesUtil.getVcsForFile(com.intellij.openapi.vcs.changes.ChangesUtil.getVcsForFile) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File) SvnVcs(org.jetbrains.idea.svn.SvnVcs) VcsDirtyScopeManager(com.intellij.openapi.vcs.changes.VcsDirtyScopeManager)

Aggregations

VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 File (java.io.File)2 SvnProgressCanceller (org.jetbrains.idea.svn.SvnProgressCanceller)2 VcsException (com.intellij.openapi.vcs.VcsException)1 ChangesUtil.getVcsForFile (com.intellij.openapi.vcs.changes.ChangesUtil.getVcsForFile)1 VcsDirtyScopeManager (com.intellij.openapi.vcs.changes.VcsDirtyScopeManager)1 SvnVcs (org.jetbrains.idea.svn.SvnVcs)1 UpdateClient (org.jetbrains.idea.svn.update.UpdateClient)1