Search in sources :

Example 1 with AddFilesOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFilesOperation in project intellij-community by JetBrains.

the class RepositoryModificationOperation method addFile.

public void addFile(String folderPath, String name, KeywordSubstitution substitution) {
    myAddedFilesCount++;
    File file = new File(folderPath, name).getAbsoluteFile();
    AddFileOperation addFilesOperation = new AddFileOperation(substitution);
    addFilesOperation.addFile(file.getAbsolutePath());
    addOperation(addFilesOperation);
    if (file.isFile())
        commitFile(file);
}
Also used : File(java.io.File) AddFileOperation(com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFileOperation)

Example 2 with AddFilesOperation

use of com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFilesOperation 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());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) AddedFileInfo(com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddedFileInfo) AddFilesOperation(com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFilesOperation)

Aggregations

AddFileOperation (com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFileOperation)1 AddFilesOperation (com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddFilesOperation)1 AddedFileInfo (com.intellij.cvsSupport2.cvsoperations.cvsAdd.AddedFileInfo)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1