use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class BrowseCvsRepositoryAction method getCvsHandler.
@Override
protected CvsHandler getCvsHandler(CvsContext context) {
final SelectCvsConfigurationDialog selectCvsConfigurationDialog = new SelectCvsConfigurationDialog(context.getProject());
if (!selectCvsConfigurationDialog.showAndGet()) {
return CvsHandler.NULL;
}
mySelectedConfiguration = selectCvsConfigurationDialog.getSelectedConfiguration();
return new MyCvsHandler();
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class BrowseCvsRepositoryAction method onActionPerformed.
@Override
protected void onActionPerformed(CvsContext context, CvsTabbedWindow tabbedWindow, boolean successfully, CvsHandler handler) {
if (mySelectedConfiguration == null)
return;
final Project project = context.getProject();
if (!loginImpl(context.getProject(), e -> VcsBalloonProblemNotifier.showOverChangesView(project, e.getMessage(), MessageType.WARNING)))
return;
super.onActionPerformed(context, tabbedWindow, successfully, handler);
if (successfully) {
LOG.assertTrue(project != null);
LOG.assertTrue(mySelectedConfiguration != null);
final BrowserPanel browserPanel = new BrowserPanel(mySelectedConfiguration, project, e -> VcsBalloonProblemNotifier.showOverChangesView(project, e.getMessage(), MessageType.ERROR));
tabbedWindow.addTab(TITLE, browserPanel, true, true, true, true, browserPanel.getActionGroup(), "cvs.browse");
}
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class AbstractAction method performAction.
protected void performAction(final Project project, final CvsHandler handler, final CvsContext context) {
final CvsOperationExecutor executor = new CvsOperationExecutor(project);
executor.performActionSync(handler, new MyCvsOperationExecutorCallback(context, handler, executor));
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class CvsCheckinEnvironment method commit.
public List<VcsException> commit(List<Change> changes, String preparedComment, @NotNull NullableFunction<Object, Object> parametersHolder, Set<String> feedback) {
final Collection<FilePath> filesList = ChangesUtil.getPaths(changes);
FilePath[] files = filesList.toArray(new FilePath[filesList.size()]);
final CvsOperationExecutor executor = new CvsOperationExecutor(myProject);
executor.setShowErrors(false);
final List<File> dirsToPrune = new ArrayList<>();
for (Change c : changes) {
if (c.getType() == Change.Type.DELETED) {
final ContentRevision contentRevision = c.getBeforeRevision();
assert contentRevision != null;
final FilePath path = contentRevision.getFile();
final FilePath parentPath = path.getParentPath();
if (parentPath != null) {
dirsToPrune.add(parentPath.getIOFile());
}
}
}
final CvsConfiguration cvsConfiguration = CvsConfiguration.getInstance(myProject);
CvsHandler handler = CommandCvsHandler.createCommitHandler(files, preparedComment, CvsBundle.message("operation.name.commit.file", files.length), cvsConfiguration.MAKE_NEW_FILES_READONLY, myProject, cvsConfiguration.TAG_AFTER_PROJECT_COMMIT, cvsConfiguration.TAG_AFTER_PROJECT_COMMIT_NAME, dirsToPrune);
executor.performActionSync(handler, CvsOperationExecutorCallback.EMPTY);
return executor.getResult().getErrorsAndWarnings();
}
use of com.intellij.cvsSupport2.cvshandlers.CvsHandler in project intellij-community by JetBrains.
the class AbstractVcsDataProvider method executeCommand.
private void executeCommand(final DirectoryContentProvider command, final GetContentCallback callback) {
final CvsOperationExecutor executor = new CvsOperationExecutor(false, callback.getProject(), callback.getModalityState());
executor.setIsQuietOperation(true);
final CancellableCvsHandler cvsHandler = new CancellableCvsHandler(CvsBundle.message("browse.repository.operation.name"), (CvsOperation) command);
callback.useForCancel(cvsHandler.getProgressListener());
executor.performActionSync(cvsHandler, new DefaultCvsOperationExecutorCallback() {
@Override
public void executionFinished(boolean successfully) {
if (!successfully) {
final List<VcsException> errors = cvsHandler.getErrorsExceptAborted();
if (!errors.isEmpty()) {
myErrorCallback.consume(errors.get(0));
}
}
callback.finished();
}
});
}
Aggregations