use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class LogCommand method execute.
// Implemented ============================================================
public final 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.LOG, clientEnvironment);
requests.addArgumentRequest(isDefaultBranch(), "-b");
requests.addArgumentRequest(isHeaderAndDescOnly(), "-t");
requests.addArgumentRequest(isHeaderOnly(), "-h");
requests.addArgumentRequest(isNoTags(), "-N");
requests.addArgumentRequest(getUserFilter(), "-w");
requests.addArgumentRequest(getRevisionFilter(), "-r");
requests.addArgumentRequest(getStateFilter(), "-s");
requests.addArgumentRequest(getDateFilter(), "-d");
addFileRequests(cvsFiles, requests, clientEnvironment);
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, EXAM_DIR);
final ICvsListener parser = createParser(eventSender, clientEnvironment.getCvsFileSystem());
final ICvsListener listener = new DualListener(parser, responseProgressHandler);
listener.registerListeners(listenerRegistry);
try {
return requestProcessor.processRequests(requests, requestsProgressHandler);
} finally {
listener.unregisterListeners(listenerRegistry);
}
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class UpdateCommand 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 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.UPDATE, clientEnvironment);
requests.addArgumentRequest(isBuildDirectories(), "-d");
requests.addArgumentRequest(isCleanCopy(), "-C");
requests.addArgumentRequest(isResetStickyOnes(), "-A");
requests.addArgumentRequest(isUseHeadIfNotFound(), "-f");
requests.addArgumentRequest(getUpdateByDate(), "-D");
requests.addArgumentRequest(getUpdateByRevision(), "-r");
requests.addArgumentRequests(getMergeRevision1(), "-j");
requests.addArgumentRequests(getMergeRevision2(), "-j");
requests.addArgumentRequest(getKeywordSubst(), "-k");
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addLocalPathDirectoryRequest();
addArgumentRequests(requests);
DirectoryPruner directoryPruner = null;
if (isPruneDirectories()) {
directoryPruner = new DirectoryPruner(clientEnvironment);
directoryPruner.registerListeners(listenerRegistry);
}
final IRequestsProgressHandler requestsProgressHandler = new FileStateRequestsProgressHandler(new RangeProgressViewer(progressViewer, 0.0, 0.5), cvsFiles);
final ICvsListener responseProgressViewer = new FileInfoAndDirectoryResponseProgressHandler(new RangeProgressViewer(progressViewer, 0.5, 1.0), cvsFiles);
final ICvsListener updateMessageParser = new UpdateMessageParser(eventSender, clientEnvironment.getCvsFileSystem());
final ICvsListener listener = new DualListener(updateMessageParser, responseProgressViewer);
listener.registerListeners(listenerRegistry);
try {
return requestProcessor.processRequests(requests, requestsProgressHandler);
} finally {
listener.unregisterListeners(listenerRegistry);
if (directoryPruner != null) {
directoryPruner.unregisterListeners(listenerRegistry);
try {
directoryPruner.pruneEmptyDirectories();
} catch (IOException ex) {
throw new IOCommandException(ex);
}
}
}
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class WatchCommand method execute.
// Implemented ============================================================
/**
* Executes this command.
*
* @param requestProcessor the client services object that provides any necessary
* services to this command, including the ability to actually
* process all the requests
* @param eventManager the EventManager used for sending events
*
* @throws IllegalStateException if the commands options aren't set correctly
* @throws CommandException if some other thing gone wrong
*/
public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewer) throws CommandException, AuthenticationException {
checkState();
final ICvsFiles cvsFiles;
try {
cvsFiles = scanFileSystem(clientEnvironment);
} catch (IOException ex) {
throw new IOCommandException(ex);
}
final Requests requests = new Requests(getWatchMode().getCommand(), clientEnvironment);
addFileRequests(cvsFiles, requests, clientEnvironment);
if (getWatchMode().isWatchOptionAllowed()) {
final String[] arguments = getWatchNotNull().getArguments();
for (int i = 0; i < arguments.length; i++) {
requests.addArgumentRequest("-a");
requests.addArgumentRequest(arguments[i]);
}
}
requests.addLocalPathDirectoryRequest();
addArgumentRequests(requests);
return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class WatchersCommand method execute.
// Implemented ============================================================
/**
* Executes this 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.WATCHERS, clientEnvironment);
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addLocalPathDirectoryRequest();
addArgumentRequests(requests);
return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class RemoveCommand 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.REMOVE, clientEnvironment);
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addLocalPathDirectoryRequest();
addArgumentRequests(requests);
final ICvsListener parser = new RemoveParser(eventSender, clientEnvironment.getCvsFileSystem());
parser.registerListeners(listenerRegistry);
try {
return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
} finally {
parser.unregisterListeners(listenerRegistry);
}
}
Aggregations