use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createCommitHandler.
public static CvsHandler createCommitHandler(FilePath[] selectedFiles, String commitMessage, String title, boolean makeNewFilesReadOnly, Project project, final boolean tagFilesAfterCommit, final String tagName, @NotNull final List<File> dirsToPrune) {
final CommitFilesOperation operation = new CommitFilesOperation(commitMessage, makeNewFilesReadOnly);
if (selectedFiles != null) {
for (FilePath selectedFile : selectedFiles) {
operation.addFile(selectedFile.getIOFile());
}
}
if (!dirsToPrune.isEmpty()) {
operation.addFinishAction(() -> {
final IOFilesBasedDirectoryPruner pruner = new IOFilesBasedDirectoryPruner(null);
for (File dir : dirsToPrune) {
pruner.addFile(dir);
}
pruner.execute();
});
}
final CommandCvsHandler result = new CommandCvsHandler(title, operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
if (tagFilesAfterCommit) {
result.addOperation(new TagOperation(selectedFiles, tagName, false, CvsConfiguration.getInstance(project).OVERRIDE_EXISTING_TAG_FOR_PROJECT));
}
return result;
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createUneditHandler.
public static CvsHandler createUneditHandler(VirtualFile[] selectedFiles, boolean makeNewFilesReadOnly) {
final UneditOperation operation = new UneditOperation(makeNewFilesReadOnly);
operation.addFiles(selectedFiles);
return new CommandCvsHandler(CvsBundle.message("operation.name.unedit"), operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CvsServicesImpl method checkout.
public CvsResult checkout(String[] modules, File checkoutTo, String directory, boolean makeNewFilesReadOnly, boolean pruneEmptyDirectories, Object keywordSubstitution, Project project, CvsRepository repository) {
LOG.assertTrue(modules.length > 0);
CheckoutProjectOperation operation = new CheckoutProjectOperation(modules, CvsRootConfiguration.createOn(repository), makeNewFilesReadOnly, checkoutTo, directory, pruneEmptyDirectories, (KeywordSubstitution) keywordSubstitution);
final CvsOperationExecutor executor = new CvsOperationExecutor(project);
executor.performActionSync(new CommandCvsHandler(CvsBundle.message("operation.name.checkout"), operation, true), CvsOperationExecutorCallback.EMPTY);
return executor.getResult();
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createAddFilesHandler.
public static CvsHandler createAddFilesHandler(final Project project, Collection<AddedFileInfo> addedRoots) {
final AddFilesOperation operation = new AddFilesOperation();
final ArrayList<AddedFileInfo> addedFileInfo = new ArrayList<>();
for (final AddedFileInfo info : addedRoots) {
info.clearAllCvsAdminDirectoriesInIncludedDirectories();
addedFileInfo.addAll(info.collectAllIncludedFiles());
}
final ArrayList<VirtualFile> addedFiles = new ArrayList<>();
for (AddedFileInfo info : addedFileInfo) {
addedFiles.add(info.getFile());
operation.addFile(info.getFile(), info.getKeywordSubstitution());
}
return new CommandCvsHandler(CvsBundle.message("action.name.add"), operation, FileSetToBeUpdated.selectedFiles(VfsUtilCore.toVirtualFileArray(addedFiles)), VcsConfiguration.getInstance(project).getAddRemoveOption());
}
use of com.intellij.cvsSupport2.cvshandlers.CommandCvsHandler in project intellij-community by JetBrains.
the class CommandCvsHandler method createTagHandler.
public static CvsHandler createTagHandler(FilePath[] selectedFiles, String tagName, boolean switchToThisTag, boolean overrideExisting, boolean makeNewFilesReadOnly, Project project) {
final CompositeOperation operation = new CompositeOperation();
operation.addOperation(new TagOperation(selectedFiles, tagName, false, overrideExisting));
if (switchToThisTag) {
operation.addOperation(new UpdateOperation(selectedFiles, tagName, makeNewFilesReadOnly, project));
}
return new CommandCvsHandler(CvsBundle.message("operation.name.create.tag"), operation, FileSetToBeUpdated.selectedFiles(selectedFiles));
}
Aggregations