use of com.intellij.cvsSupport2.cvsoperations.cvsCommit.CommitFilesOperation 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;
}
Aggregations