Search in sources :

Example 6 with Requests

use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.

the class EditorsCommand method execute.

// Implemented ============================================================
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventSender, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    final ICvsFiles cvsFiles;
    try {
        cvsFiles = scanFileSystem(clientEnvironment);
    } catch (IOException ex) {
        throw new IOCommandException(ex);
    }
    final Requests requests = new Requests(CommandRequest.EDITORS, clientEnvironment);
    addFileRequests(cvsFiles, requests, clientEnvironment);
    requests.addLocalPathDirectoryRequest();
    addArgumentRequests(requests);
    final ICvsListener builder = new EditorsMessageParser(eventSender, clientEnvironment.getCvsFileSystem(), cvsFiles);
    builder.registerListeners(listenerRegistry);
    try {
        return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
    } finally {
        builder.unregisterListeners(listenerRegistry);
    }
}
Also used : ICvsListener(org.netbeans.lib.cvsclient.event.ICvsListener) ICvsFiles(org.netbeans.lib.cvsclient.command.ICvsFiles) IOException(java.io.IOException) Requests(org.netbeans.lib.cvsclient.request.Requests) IOCommandException(org.netbeans.lib.cvsclient.command.IOCommandException)

Example 7 with Requests

use of org.netbeans.lib.cvsclient.request.Requests 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 8 with Requests

use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.

the class TagCommand method execute.

// Implemented ============================================================
/**
	 * Execute the command.
	 *
	 * @param requestProcessor the client services object that provides any necessary
	 *               services to this command, including the ability to actually
	 *               process all the requests.
	 */
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    final ICvsFiles cvsFiles;
    try {
        cvsFiles = scanFileSystem(clientEnvironment);
    } catch (IOException ex) {
        throw new IOCommandException(ex);
    }
    final Requests requests = new Requests(CommandRequest.TAG, clientEnvironment);
    addFileRequests(cvsFiles, requests, clientEnvironment);
    requests.addArgumentRequest(isDeleteTag(), "-d");
    requests.addArgumentRequest(isMakeBranchTag(), "-b");
    requests.addArgumentRequest(isCheckThatUnmodified(), "-c");
    requests.addArgumentRequest(isOverrideExistingTag(), "-F");
    requests.addArgumentRequest(isAllowMoveDeleteBranchTag(), "-B");
    requests.addArgumentRequest(true, getTag());
    requests.addLocalPathDirectoryRequest();
    addArgumentRequests(requests);
    final IRequestsProgressHandler requestsProgressHandler = new FileStateRequestsProgressHandler(new RangeProgressViewer(progressViewer, 0.0, 0.5), cvsFiles);
    final ICvsListener responseProgressHandler = new FileInfoAndMessageResponseProgressHandler(new RangeProgressViewer(progressViewer, 0.5, 1.0), cvsFiles, isDeleteTag() ? EXAM_DIR_UNTAG : EXAM_DIR_TAG);
    final ICvsListener tagParser = new TagParser(eventManager, clientEnvironment.getCvsFileSystem());
    final ICvsListener listener = new DualListener(tagParser, responseProgressHandler);
    listener.registerListeners(listenerRegistry);
    try {
        return requestProcessor.processRequests(requests, requestsProgressHandler);
    } finally {
        listener.unregisterListeners(listenerRegistry);
    }
}
Also used : FileInfoAndMessageResponseProgressHandler(org.netbeans.lib.cvsclient.progress.receiving.FileInfoAndMessageResponseProgressHandler) RangeProgressViewer(org.netbeans.lib.cvsclient.progress.RangeProgressViewer) FileStateRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.FileStateRequestsProgressHandler) ICvsListener(org.netbeans.lib.cvsclient.event.ICvsListener) ICvsFiles(org.netbeans.lib.cvsclient.command.ICvsFiles) IOException(java.io.IOException) IRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.IRequestsProgressHandler) Requests(org.netbeans.lib.cvsclient.request.Requests) IOCommandException(org.netbeans.lib.cvsclient.command.IOCommandException) DualListener(org.netbeans.lib.cvsclient.event.DualListener)

Example 9 with Requests

use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.

the class ChangeKeywordSubstCommand method execute.

public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    BugLog.getInstance().assertNotNull(keywordSubstitution);
    final ICvsFiles cvsFiles;
    try {
        cvsFiles = scanFileSystem(clientEnvironment);
    } catch (IOException ex) {
        throw new IOCommandException(ex);
    }
    final Requests requests = new Requests(CommandRequest.ADMIN, clientEnvironment);
    requests.addArgumentRequest(keywordSubstitution, "-k");
    addFileRequests(cvsFiles, requests, clientEnvironment);
    requests.addLocalPathDirectoryRequest();
    addArgumentRequests(requests);
    return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
Also used : IOException(java.io.IOException) Requests(org.netbeans.lib.cvsclient.request.Requests)

Example 10 with Requests

use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.

the class RtagCommand method execute.

public final boolean execute(IRequestProcessor requestProcessor, IEventSender eventSender, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
    final Requests requests = new Requests(CommandRequest.RTAG, clientEnvironment);
    requests.addArgumentRequest(myOverrideExistings, "-F");
    requests.addArgumentRequest(true, myTagName);
    for (AbstractFileObject fileObject : getFileObjects()) {
        String path = fileObject.getPath();
        if (StringUtil.startsWithChar(path, '/'))
            path = path.substring(1);
        requests.addArgumentRequest(path);
    }
    return requestProcessor.processRequests(requests, new DummyRequestsProgressHandler());
}
Also used : DummyRequestsProgressHandler(org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler) AbstractFileObject(org.netbeans.lib.cvsclient.file.AbstractFileObject) Requests(org.netbeans.lib.cvsclient.request.Requests)

Aggregations

Requests (org.netbeans.lib.cvsclient.request.Requests)24 IOException (java.io.IOException)18 ICvsListener (org.netbeans.lib.cvsclient.event.ICvsListener)11 IOCommandException (org.netbeans.lib.cvsclient.command.IOCommandException)10 DummyRequestsProgressHandler (org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler)10 ICvsFiles (org.netbeans.lib.cvsclient.command.ICvsFiles)8 RangeProgressViewer (org.netbeans.lib.cvsclient.progress.RangeProgressViewer)6 IRequestsProgressHandler (org.netbeans.lib.cvsclient.progress.sending.IRequestsProgressHandler)6 DualListener (org.netbeans.lib.cvsclient.event.DualListener)5 FileStateRequestsProgressHandler (org.netbeans.lib.cvsclient.progress.sending.FileStateRequestsProgressHandler)5 FileInfoAndMessageResponseProgressHandler (org.netbeans.lib.cvsclient.progress.receiving.FileInfoAndMessageResponseProgressHandler)4 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 FileInfoAndDirectoryResponseProgressHandler (org.netbeans.lib.cvsclient.progress.receiving.FileInfoAndDirectoryResponseProgressHandler)1