use of org.netbeans.lib.cvsclient.request.Requests 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);
}
}
use of org.netbeans.lib.cvsclient.request.Requests 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 {
}
}
use of org.netbeans.lib.cvsclient.request.Requests 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);
}
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class CommitCommand 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.COMMIT, clientEnvironment);
requests.addArgumentRequest(isForceCommit(), "-f");
requests.addArgumentRequest(isRecursive(), "-R");
requests.addArgumentRequest(isNoModuleProgram(), "-n");
requests.addArgumentRequest(getToRevisionOrBranch(), "-r");
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addMessageRequests(CommandUtils.getMessageNotNull(getMessage()));
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 commitParser = new CommitParser(eventSender, clientEnvironment.getCvsFileSystem());
final ICvsListener parser = new DualListener(commitParser, responseProgressHandler);
parser.registerListeners(listenerRegistry);
try {
return requestProcessor.processRequests(requests, requestsProgressHandler);
} finally {
parser.unregisterListeners(listenerRegistry);
}
}
use of org.netbeans.lib.cvsclient.request.Requests in project intellij-community by JetBrains.
the class EditCommand 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);
}
if (isCheckThatUnedited()) {
editors = true;
final Requests requests = new Requests(CommandRequest.EDITORS, clientEnvironment);
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addLocalPathDirectoryRequest();
addArgumentRequests(requests);
final EditEditorsMessageParser parser = new EditEditorsMessageParser(clientEnvironment.getCvsRoot().getUser());
parser.registerListeners(listenerRegistry);
try {
final RangeProgressViewer editorsProgressViewer = new RangeProgressViewer(progressViewer, 0.0, 0.5);
requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(editorsProgressViewer, cvsFiles));
} finally {
parser.unregisterListeners(listenerRegistry);
}
if (parser.isFilesEdited()) {
final String message = JavaCvsSrcBundle.message("cannot.edit.files.they.are.edited.error.message");
eventSender.notifyMessageListeners(message.getBytes(), true, false);
return false;
}
progressViewer = new RangeProgressViewer(progressViewer, 0.5, 1.0);
}
editors = false;
final Requests requests = new Requests(CommandRequest.NOOP, clientEnvironment);
addFileRequests(cvsFiles, requests, clientEnvironment);
requests.addArgumentRequest(isCheckThatUnedited(), "-c");
requests.addArgumentRequest(isForceEvenIfEdited(), "-f");
requests.addLocalPathDirectoryRequest();
return requestProcessor.processRequests(requests, FileStateRequestsProgressHandler.create(progressViewer, cvsFiles));
}
Aggregations