use of org.netbeans.lib.cvsclient.event.ICvsListener 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.event.ICvsListener 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);
}
}
use of org.netbeans.lib.cvsclient.event.ICvsListener 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);
}
}
use of org.netbeans.lib.cvsclient.event.ICvsListener 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);
}
}
use of org.netbeans.lib.cvsclient.event.ICvsListener 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);
}
}
Aggregations