use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CvsVcs2 method executeQuietOperation.
public static CvsOperationExecutor executeQuietOperation(String title, CvsOperation operation, final Project project) {
CvsOperationExecutor executor = new CvsOperationExecutor(false, project, ModalityState.defaultModalityState());
executor.setIsQuietOperation(true);
executor.performActionSync(new CommandCvsHandler(title, operation), CvsOperationExecutorCallback.EMPTY);
return executor;
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class TagsHelper method getBranchesProvider.
private static BranchesProvider getBranchesProvider(CvsOperation operation, Project project) throws VcsException {
LOG.assertTrue(operation instanceof BranchesProvider);
final CvsOperationExecutor executor = new CvsOperationExecutor(true, project, new ModalityContextImpl(ModalityState.defaultModalityState()));
final CommandCvsHandler handler = new CommandCvsHandler(CvsBundle.message("load.tags.operation.name"), operation, true);
executor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
final CvsResult executionResult = executor.getResult();
if (executionResult.hasErrors())
throw executionResult.composeError();
return (BranchesProvider) operation;
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createRestoreFileHandler.
public static CvsHandler createRestoreFileHandler(final VirtualFile parent, String name, boolean makeNewFilesReadOnly) {
final File ioFile = new File(VfsUtilCore.virtualToIoFile(parent), name);
final Entry entry = CvsEntriesManager.getInstance().getEntryFor(parent, name);
final String revision = getRevision(entry);
final CheckoutFileOperation operation = new CheckoutFileOperation(parent, new SimpleRevision(revision), name, makeNewFilesReadOnly);
final CommandCvsHandler cvsHandler = new CommandCvsHandler(CvsBundle.message("operation.name.restore"), operation, FileSetToBeUpdated.EMPTY);
operation.addFinishAction(() -> {
final List<VcsException> errors = cvsHandler.getErrors();
if (errors != null && !errors.isEmpty())
return;
if (entry != null) {
entry.setRevision(revision);
entry.setConflict(CvsUtil.formatDate(new Date(ioFile.lastModified())));
try {
CvsUtil.saveEntryForFile(ioFile, entry);
} catch (IOException e) {
LOG.error(e);
}
CvsEntriesManager.getInstance().clearCachedEntriesFor(parent);
}
});
return cvsHandler;
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createEditHandler.
public static CvsHandler createEditHandler(VirtualFile[] selectedFiles, boolean isReservedEdit) {
final EditOperation operation = new EditOperation(isReservedEdit);
operation.addFiles(selectedFiles);
return new CommandCvsHandler(CvsBundle.message("action.name.edit"), operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createGetFileFromRepositoryHandler.
public static CvsHandler createGetFileFromRepositoryHandler(CvsLightweightFile[] cvsLightweightFiles, boolean makeNewFilesReadOnly) {
final CompositeOperation compositeOperation = new CompositeOperation();
final CvsEntriesManager entriesManager = CvsEntriesManager.getInstance();
for (CvsLightweightFile cvsLightweightFile : cvsLightweightFiles) {
final File root = cvsLightweightFile.getRoot();
File workingDirectory = root;
if (workingDirectory == null)
continue;
if (cvsLightweightFile.getLocalFile().getParentFile().equals(workingDirectory)) {
workingDirectory = workingDirectory.getParentFile();
}
final String alternativeCheckoutPath = getAlternativeCheckoutPath(cvsLightweightFile, workingDirectory);
final CheckoutProjectOperation checkoutFileOperation = new CheckoutProjectOperation(new String[] { cvsLightweightFile.getModuleName() }, entriesManager.getCvsConnectionSettingsFor(root), makeNewFilesReadOnly, workingDirectory, alternativeCheckoutPath, true, null);
compositeOperation.addOperation(checkoutFileOperation);
}
return new CommandCvsHandler(CvsBundle.message("action.name.get.file.from.repository"), compositeOperation, FileSetToBeUpdated.allFiles(), true);
}
Aggregations