use of com.intellij.cvsSupport2.actions.merge.CvsMergeProvider in project intellij-community by JetBrains.
the class CvsUpdateEnvironment method invokeManualMerging.
private static List<VirtualFile> invokeManualMerging(Collection<String> paths, Project project) {
final List<VirtualFile> readOnlyFiles = new ArrayList<>();
final List<VirtualFile> files = new ArrayList<>();
for (final String path : paths) {
final VirtualFile virtualFile = CvsVfsUtil.findFileByIoFile(new File(path));
if (virtualFile != null) {
files.add(virtualFile);
if (!virtualFile.isWritable()) {
readOnlyFiles.add(virtualFile);
}
}
}
if (readOnlyFiles.size() > 0) {
final CvsHandler editHandler = CommandCvsHandler.createEditHandler(VfsUtil.toVirtualFileArray(readOnlyFiles), CvsConfiguration.getInstance(project).RESERVED_EDIT);
new CvsOperationExecutor(true, project, ModalityState.current()).performActionSync(editHandler, CvsOperationExecutorCallback.EMPTY);
ApplicationManager.getApplication().runWriteAction(() -> {
for (VirtualFile file : readOnlyFiles) {
file.refresh(false, false);
}
});
}
if (!files.isEmpty()) {
return AbstractVcsHelper.getInstance(project).showMergeDialog(files, new CvsMergeProvider());
}
return Collections.emptyList();
}
Aggregations