use of com.intellij.openapi.cvsIntegration.CvsResult 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.openapi.cvsIntegration.CvsResult 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.openapi.cvsIntegration.CvsResult in project intellij-community by JetBrains.
the class CvsUpdateEnvironment method updateDirectories.
@NotNull
public UpdateSession updateDirectories(@NotNull FilePath[] contentRoots, final UpdatedFiles updatedFiles, ProgressIndicator progressIndicator, @NotNull final Ref<SequentialUpdatesContext> contextRef) {
CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(myProject);
if (!myLastUpdateWasConfigured) {
cvsConfiguration.CLEAN_COPY = false;
cvsConfiguration.RESET_STICKY = false;
}
myLastUpdateWasConfigured = false;
try {
final UpdateSettingsOnCvsConfiguration updateSettings = createSettingsAndUpdateContext(cvsConfiguration, contextRef);
final UpdateHandler handler = CommandCvsHandler.createUpdateHandler(contentRoots, updateSettings, myProject, updatedFiles);
handler.addCvsListener(new UpdatedFilesProcessor(updatedFiles));
CvsOperationExecutor cvsOperationExecutor = new CvsOperationExecutor(true, myProject, ModalityState.defaultModalityState());
cvsOperationExecutor.setShowErrors(false);
cvsOperationExecutor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
final CvsResult result = cvsOperationExecutor.getResult();
return createUpdateSessionAdapter(updatedFiles, result);
} finally {
cvsConfiguration.CLEAN_COPY = false;
cvsConfiguration.RESET_STICKY = false;
}
}
use of com.intellij.openapi.cvsIntegration.CvsResult 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;
}
use of com.intellij.openapi.cvsIntegration.CvsResult in project intellij-community by JetBrains.
the class CvsCommittedChangesProvider method loadCommittedChanges.
private List<CvsChangeList> loadCommittedChanges(final ChangeBrowserSettings settings, final String module, CvsEnvironment connectionSettings, final VirtualFile rootFile) throws VcsException {
if (connectionSettings.isOffline()) {
return Collections.emptyList();
}
final CvsChangeListsBuilder builder = new CvsChangeListsBuilder(module, connectionSettings, myProject, rootFile);
final Date dateTo = settings.getDateBeforeFilter();
Date dateFrom = settings.getDateAfterFilter();
if (dateFrom == null) {
final Calendar calendar = Calendar.getInstance();
calendar.set(1970, Calendar.MARCH, 2);
dateFrom = calendar.getTime();
}
final LoadHistoryOperation operation = new LoadHistoryOperation(connectionSettings, module, dateFrom, dateTo, logInformationWrapper -> builder.add(logInformationWrapper));
final CvsResult executionResult = operation.run(myProject);
if (executionResult.isCanceled()) {
throw new ProcessCanceledException();
} else if (executionResult.hasErrors()) {
throw executionResult.composeError();
} else {
final List<CvsChangeList> versions = builder.getVersions();
settings.filterChanges(versions);
return versions;
}
}
Aggregations