Search in sources :

Example 6 with CvsHandler

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();
}
Also used : SelectCvsConfigurationDialog(com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)

Example 7 with CvsHandler

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");
    }
}
Also used : CvsTabbedWindow(com.intellij.cvsSupport2.ui.CvsTabbedWindow) MessageType(com.intellij.openapi.ui.MessageType) FileSetToBeUpdated(com.intellij.cvsSupport2.cvshandlers.FileSetToBeUpdated) VcsContext(com.intellij.openapi.vcs.actions.VcsContext) Presentation(com.intellij.openapi.actionSystem.Presentation) CvsHandler(com.intellij.cvsSupport2.cvshandlers.CvsHandler) CvsBundle(com.intellij.CvsBundle) VcsBalloonProblemNotifier(com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier) CvsContext(com.intellij.cvsSupport2.actions.cvsContext.CvsContext) BrowserPanel(com.intellij.cvsSupport2.cvsBrowser.ui.BrowserPanel) LoginPerformer(com.intellij.cvsSupport2.cvsoperations.common.LoginPerformer) AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) SelectCvsConfigurationDialog(com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog) Project(com.intellij.openapi.project.Project) CommonDataKeys(com.intellij.openapi.actionSystem.CommonDataKeys) DumbAware(com.intellij.openapi.project.DumbAware) VcsException(com.intellij.openapi.vcs.VcsException) Collections(java.util.Collections) CvsRootConfiguration(com.intellij.cvsSupport2.config.CvsRootConfiguration) Consumer(com.intellij.util.Consumer) CvsEnvironment(com.intellij.cvsSupport2.connections.CvsEnvironment) Project(com.intellij.openapi.project.Project) BrowserPanel(com.intellij.cvsSupport2.cvsBrowser.ui.BrowserPanel)

Example 8 with CvsHandler

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));
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)

Example 9 with CvsHandler

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();
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) CvsConfiguration(com.intellij.cvsSupport2.config.CvsConfiguration) CommandCvsHandler(com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler) CvsHandler(com.intellij.cvsSupport2.cvshandlers.CvsHandler) CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) ContentRevision(com.intellij.openapi.vcs.changes.ContentRevision) Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) File(java.io.File)

Example 10 with CvsHandler

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();
        }
    });
}
Also used : CvsOperationExecutor(com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor) DefaultCvsOperationExecutorCallback(com.intellij.cvsSupport2.cvsExecution.DefaultCvsOperationExecutorCallback) List(java.util.List)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 CommandCvsHandler (com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler)10 CvsHandler (com.intellij.cvsSupport2.cvshandlers.CvsHandler)10 CvsOperationExecutor (com.intellij.cvsSupport2.cvsExecution.CvsOperationExecutor)9 Project (com.intellij.openapi.project.Project)9 FilePath (com.intellij.openapi.vcs.FilePath)9 File (java.io.File)7 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)4 CvsTabbedWindow (com.intellij.cvsSupport2.ui.CvsTabbedWindow)4 CvsContext (com.intellij.cvsSupport2.actions.cvsContext.CvsContext)3 CvsConfiguration (com.intellij.cvsSupport2.config.CvsConfiguration)3 SelectCvsConfigurationDialog (com.intellij.cvsSupport2.config.ui.SelectCvsConfigurationDialog)2 TagOperation (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation)2 CreateTagDialog (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.ui.CreateTagDialog)2 UpdateOperation (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)2 WatchOperation (com.intellij.cvsSupport2.cvsoperations.cvsWatch.WatchOperation)2 CheckoutWizard (com.intellij.cvsSupport2.ui.experts.checkout.CheckoutWizard)2 VcsException (com.intellij.openapi.vcs.VcsException)2 VcsContext (com.intellij.openapi.vcs.actions.VcsContext)2 ArrayList (java.util.ArrayList)2