Search in sources :

Example 1 with DummyRequestsProgressHandler

use of org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler in project intellij-community by JetBrains.

the class CheckoutCommand method expandModules.

// Utils ==================================================================
private boolean expandModules(ExpandedModules expandedModules, ICvsListenerRegistry listenerRegistry, IRequestProcessor requestProcessor, IClientEnvironment clientEnvironment) throws CommandException, AuthenticationException {
    final Requests requests = new Requests(new ExpandModulesRequest(), clientEnvironment);
    addModuleArguments(requests);
    requests.addLocalPathDirectoryRequest();
    expandedModules.registerListeners(listenerRegistry);
    try {
        return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
    } finally {
        expandedModules.unregisterListeners(listenerRegistry);
    }
}
Also used : DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) ExpandModulesRequest(org.netbeans.lib.cvsclient.request.ExpandModulesRequest) Requests(org.netbeans.lib.cvsclient.request.Requests)

Example 2 with DummyRequestsProgressHandler

use of org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler in project intellij-community by JetBrains.

the class ExportCommand method checkout.

private boolean checkout(ExpandedModules expandedModules, IRequestProcessor requestProcessor, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment) throws CommandException, AuthenticationException {
    // we first see whether the modules specified actually exist
    // checked out already. If so, we must work something like an update
    // command and send modified files to the server.
    processExistingModules(expandedModules, clientEnvironment);
    final Requests requests;
    requests = new Requests(CommandRequest.EXPORT, clientEnvironment);
    if (getAlternativeCheckoutDirectory() != null) {
        requests.addArgumentRequest("-d");
        requests.addArgumentRequest(getAlternativeCheckoutDirectory());
    }
    requests.addArgumentRequest(!isRecursive(), "-l");
    requests.addArgumentRequest(getUpdateByDate(), "-D");
    requests.addArgumentRequest(getUpdateByRevisionOrTag(), "-r");
    requests.addArgumentRequest(getKeywordSubstitution(), "-k");
    addModuleArguments(requests);
    requests.addLocalPathDirectoryRequest();
    try {
        return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
    } finally {
    }
}
Also used : DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) Requests(org.netbeans.lib.cvsclient.request.Requests)

Example 3 with DummyRequestsProgressHandler

use of org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler in project intellij-community by JetBrains.

the class ExportCommand method expandModules.

// Utils ==================================================================
private boolean expandModules(ExpandedModules expandedModules, ICvsListenerRegistry listenerRegistry, IRequestProcessor requestProcessor, IClientEnvironment clientEnvironment) throws CommandException, AuthenticationException {
    final Requests requests = new Requests(new ExpandModulesRequest(), clientEnvironment);
    addModuleArguments(requests);
    requests.addLocalPathDirectoryRequest();
    expandedModules.registerListeners(listenerRegistry);
    try {
        return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
    } finally {
        expandedModules.unregisterListeners(listenerRegistry);
    }
}
Also used : DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) ExpandModulesRequest(org.netbeans.lib.cvsclient.request.ExpandModulesRequest) Requests(org.netbeans.lib.cvsclient.request.Requests)

Example 4 with DummyRequestsProgressHandler

use of org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler in project intellij-community by JetBrains.

the class RlogCommand method execute.

// Implemented ============================================================
public final boolean execute(IRequestProcessor requestProcessor, IEventSender eventSender, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    final Requests requests = new Requests(CommandRequest.RLOG, clientEnvironment);
    requests.addArgumentRequest(myHeadersOnly, "-h");
    requests.addArgumentRequest(myNoTags, "-N");
    requests.addArgumentRequest(mySuppressEmptyHeaders, "-S");
    requests.addArgumentRequest(!isRecursive(), "-l");
    requests.addArgumentRequest(getDateFilter(), "-d");
    final String revisionFilter = getRevisionFilter();
    if (revisionFilter != null) {
        requests.addArgumentRequest("-r" + revisionFilter);
    } else if (myBranchName != null) {
        requests.addArgumentRequest("-r" + myBranchName);
    }
    requests.addArgumentRequest(myLogDefaultBranch, "-b");
    requests.addArgumentRequest(myModuleName);
    final ICvsListener parser = new LogMessageParser(eventSender, clientEnvironment.getCvsFileSystem());
    parser.registerListeners(listenerRegistry);
    try {
        return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
    } finally {
        parser.unregisterListeners(listenerRegistry);
    }
}
Also used : LogMessageParser(org.netbeans.lib.cvsclient.command.log.LogMessageParser) DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) ICvsListener(org.netbeans.lib.cvsclient.event.ICvsListener) Requests(org.netbeans.lib.cvsclient.request.Requests)

Example 5 with DummyRequestsProgressHandler

use of org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler in project intellij-community by JetBrains.

the class AddCommand method execute.

// Implemented ============================================================
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    BugLog.getInstance().assertTrue(getFileObjects().size() > 0, "No file specified.");
    repositoryPathToDirectoryObject.clear();
    final Requests requests;
    try {
        requests = new Requests(CommandRequest.ADD, clientEnvironment);
        requests.addArgumentRequest(getKeywordSubst(), "-k");
        for (AbstractFileObject abstractFileObject : getFileObjects()) {
            addRequests(abstractFileObject, requests, requestProcessor, clientEnvironment);
        }
        requests.addLocalPathDirectoryRequest();
        addArgumentRequests(requests);
    } catch (IOException ex) {
        throw new IOCommandException(ex);
    }
    final ICvsListener parser = new AddParser(eventManager, clientEnvironment.getCvsFileSystem());
    parser.registerListeners(listenerRegistry);
    try {
        final boolean result = requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
        createCvsDirectories(clientEnvironment);
        return result;
    } catch (IOException ex) {
        throw new IOCommandException(ex);
    } finally {
        repositoryPathToDirectoryObject.clear();
        parser.unregisterListeners(listenerRegistry);
    }
}
Also used : DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) ICvsListener(org.netbeans.lib.cvsclient.event.ICvsListener) IOException(java.io.IOException) AbstractFileObject(org.netbeans.lib.cvsclient.file.AbstractFileObject) Requests(org.netbeans.lib.cvsclient.request.Requests) IOCommandException(org.netbeans.lib.cvsclient.command.IOCommandException)

Aggregations

DummyRequestsProgressHandler (org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler)10 Requests (org.netbeans.lib.cvsclient.request.Requests)10 IOException (java.io.IOException)4 ICvsListener (org.netbeans.lib.cvsclient.event.ICvsListener)3 IOCommandException (org.netbeans.lib.cvsclient.command.IOCommandException)2 AbstractFileObject (org.netbeans.lib.cvsclient.file.AbstractFileObject)2 DirectoryRequest (org.netbeans.lib.cvsclient.request.DirectoryRequest)2 ExpandModulesRequest (org.netbeans.lib.cvsclient.request.ExpandModulesRequest)2 File (java.io.File)1 LogMessageParser (org.netbeans.lib.cvsclient.command.log.LogMessageParser)1