Search in sources :

Example 1 with TagOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation 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;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) CommitFilesOperation(com.intellij.cvsSupport2.cvsoperations.cvsCommit.CommitFilesOperation) TagOperation(com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation) VirtualFile(com.intellij.openapi.vfs.VirtualFile) CvsLightweightFile(com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile) File(java.io.File)

Example 2 with TagOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation 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));
}
Also used : TagOperation(com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation) UpdateOperation(com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)

Aggregations

TagOperation (com.intellij.cvsSupport2.cvsoperations.cvsTagOrBranch.TagOperation)2 CvsLightweightFile (com.intellij.cvsSupport2.actions.cvsContext.CvsLightweightFile)1 CommitFilesOperation (com.intellij.cvsSupport2.cvsoperations.cvsCommit.CommitFilesOperation)1 UpdateOperation (com.intellij.cvsSupport2.cvsoperations.cvsUpdate.UpdateOperation)1 FilePath (com.intellij.openapi.vcs.FilePath)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1