use of org.jetbrains.idea.svn.dialogs.RelocateDialog in project intellij-community by JetBrains.
the class RelocateAction method perform.
@Override
protected void perform(@NotNull SvnVcs vcs, @NotNull VirtualFile file, @NotNull DataContext context) throws VcsException {
Info info = vcs.getInfo(file);
assert info != null;
RelocateDialog dlg = new RelocateDialog(vcs.getProject(), info.getURL());
if (!dlg.showAndGet()) {
return;
}
String beforeURL = dlg.getBeforeURL();
String afterURL = dlg.getAfterURL();
if (beforeURL.equals(afterURL))
return;
ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
if (indicator != null) {
indicator.setIndeterminate(true);
}
try {
File path = VfsUtilCore.virtualToIoFile(file);
vcs.getFactory(path).createRelocateClient().relocate(path, beforeURL, afterURL);
VcsDirtyScopeManager.getInstance(vcs.getProject()).markEverythingDirty();
} catch (VcsException e) {
runOrInvokeLaterAboveProgress(() -> Messages.showErrorDialog(vcs.getProject(), "Error relocating working copy: " + e.getMessage(), "Relocate Working Copy"), null, vcs.getProject());
}
}, "Relocating Working Copy", false, vcs.getProject());
}
Aggregations