use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createBranchHandler.
public static CvsHandler createBranchHandler(FilePath[] selectedFiles, String branchName, boolean switchToThisBranch, boolean overrideExisting, boolean makeNewFilesReadOnly, Project project) {
final CompositeOperation operation = new CompositeOperation();
operation.addOperation(new BranchOperation(selectedFiles, branchName, overrideExisting));
if (switchToThisBranch) {
operation.addOperation(new UpdateOperation(selectedFiles, branchName, makeNewFilesReadOnly, project));
}
return new CommandCvsHandler(CvsBundle.message("operation.name.create.branch"), operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class ComparableVcsRevisionOnOperation method loadContent.
public byte[] loadContent() throws IOException, VcsException {
if (!myOperation.isLoaded()) {
CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.performActionSync(new CommandCvsHandler(CvsBundle.message("operation.name.load.file"), myOperation), CvsOperationExecutorCallback.EMPTY);
CvsResult result = executor.getResult();
if (result.isCanceled()) {
throw new ProcessCanceledException();
}
if (result.hasErrors()) {
throw result.composeError();
}
}
return getContent();
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class AbstractWatchAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
CvsConfiguration configuration = CvsConfiguration.getInstance(context.getProject());
WatcherDialog dialog = createDialog(configuration, context);
if (!dialog.showAndGet()) {
return CvsHandler.NULL;
}
Watch watch = dialog.getWatch();
saveWatch(configuration, watch);
WatchOperation watchOperation = new WatchOperation(getWatchOperation(), watch);
VirtualFile[] files = context.getSelectedFiles();
for (int i = 0; i < files.length; i++) {
watchOperation.addFile(files[i]);
}
return new CommandCvsHandler(getTitle(context), watchOperation);
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class AbstractWatchOnOffAction method getCvsHandler.
protected CvsHandler getCvsHandler(CvsContext context) {
WatchOperation watchOperation = new WatchOperation(getMode());
VirtualFile[] files = context.getSelectedFiles();
for (VirtualFile file : files) {
watchOperation.addFile(file);
}
return new CommandCvsHandler(getTitle(context), watchOperation);
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CvsAnnotationProvider method executeOperation.
private AnnotateOperation executeOperation(File file, String revision, CvsEnvironment root, boolean binary, boolean retryOnFailure) throws VcsException {
final AnnotateOperation operation = new AnnotateOperation(file, revision, root, binary);
final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.performActionSync(new CommandCvsHandler(CvsBundle.getAnnotateOperationName(), operation), CvsOperationExecutorCallback.EMPTY);
final CvsResult result = executor.getResult();
if (result.hasErrors()) {
if (!retryOnFailure) {
throw result.composeError();
}
for (VcsException error : result.getErrors()) {
for (String message : error.getMessages()) {
if (message.contains(INVALID_OPTION_F) || message.contains(USAGE_CVSNTSRV_SERVER)) {
ourDoNotAnnotateBinaryRoots.add(root.getCvsRootAsString());
return executeOperation(file, revision, root, false, false);
}
}
}
throw result.composeError();
}
return operation;
}
Aggregations