void (@NotNull ProgressIndicator indicator) { LocalHistoryAction action = LocalHistory.getInstance().startAction(myActionTitle); try { TriggerAdditionOrDeletion trigger = new TriggerAdditionOrDeletion(myProject); Object commandGroup = new Object(); for (FileRevisionProvider provider : myProviders) { FilePath localFilePath = provider.getFilePath(); FileRevisionContent revisionContent = provider.getContent(); Ref<IOException> exRef = new Ref<>(); ApplicationManager.getApplication().invokeAndWait(() -> { try { CommandProcessor.getInstance().executeCommand(myProject, () -> { VirtualFile virtualFile = localFilePath.getVirtualFile(); if (revisionContent == null && virtualFile == null) return; if (revisionContent == null) { trigger.prepare(Collections.emptyList(), Collections.singletonList(localFilePath)); } else if (virtualFile == null) { trigger.prepare(Collections.singletonList(localFilePath), Collections.emptyList()); } ApplicationManager.getApplication().runWriteAction(() -> { try { if (revisionContent == null) { writeDeletion(virtualFile); } else if (virtualFile == null) { FilePath path = ObjectUtils.chooseNotNull(revisionContent.oldFilePath, localFilePath); writeCreation(path, revisionContent.bytes); } else { if (revisionContent.oldFilePath != null && !localFilePath.equals(revisionContent.oldFilePath)) { writeRename(virtualFile, revisionContent.oldFilePath); } writeModification(virtualFile, revisionContent.bytes); } } catch (IOException e) { exRef.set(e); } }); }, VcsBundle.message("message.title.get.version"), commandGroup); } finally { trigger.cleanup(); } }); if (!exRef.isNull()) throw exRef.get(); } trigger.processIt(); } catch (IOException e) { ApplicationManager.getApplication().invokeLater( () -> Messages.showMessageDialog(VcsBundle.message("message.text.cannot.save.content", e.getLocalizedMessage()), VcsBundle.message("message.title.get.revision.content"), Messages.getErrorIcon())); } catch (VcsException e) { LOG.info(e); ApplicationManager.getApplication().invokeLater( () -> Messages.showMessageDialog(VcsBundle.message("message.text.cannot.load.revision", e.getLocalizedMessage()), VcsBundle.message("message.title.get.revision.content"), Messages.getInformationIcon())); } finally { action.finish(); } }