Search in sources :

Example 1 with FileGroup

use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.

the class UpdateEventHandler method setRevisionForWaitingFiles.

private void setRevisionForWaitingFiles(long revisionNumber) {
    SvnRevisionNumber revision = new SvnRevisionNumber(SVNRevision.create(revisionNumber));
    for (Pair<String, String> pair : myFilesWaitingForRevision.pop()) {
        FileGroup fileGroup = myUpdatedFiles.getGroupById(pair.getFirst());
        fileGroup.add(pair.getSecond(), SvnVcs.getKey(), revision);
    }
}
Also used : SvnRevisionNumber(org.jetbrains.idea.svn.SvnRevisionNumber) FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Example 2 with FileGroup

use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.

the class ResolveWorker method needsInteraction.

public boolean needsInteraction(final UpdatedFiles updatedFiles) {
    if (myChangesUnderProjectRoot) {
        refreshChangeListsFindConflicts(updatedFiles);
    } else {
        final FileGroup conflictedGroup = updatedFiles.getGroupById(FileGroup.MERGED_WITH_CONFLICT_ID);
        for (String filename : conflictedGroup.getFiles()) {
            final VirtualFile vf = SvnUtil.getVirtualFile(filename);
            myConflictedVirtualFiles.add(vf);
        }
    }
    return ((!myConflictedVirtualFiles.isEmpty()) || (!haveUnresolvedConflicts(updatedFiles))) && (!SvnConfiguration.getInstance(myProject).isMergeDryRun());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Example 3 with FileGroup

use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.

the class ResolveWorker method execute.

// on EDT, dispose checked
public void execute(final UpdatedFiles updatedFiles) {
    if (myConflictedVirtualFiles.isEmpty()) {
        return;
    }
    final AbstractVcsHelper vcsHelper = AbstractVcsHelper.getInstance(myProject);
    List<VirtualFile> mergedFiles = vcsHelper.showMergeDialog(myConflictedVirtualFiles, new SvnMergeProvider(myProject));
    final FileGroup mergedGroup = updatedFiles.getGroupById(FileGroup.MERGED_ID);
    final FileGroup conflictedGroup = updatedFiles.getGroupById(FileGroup.MERGED_WITH_CONFLICT_ID);
    final VcsKey vcsKey = SvnVcs.getKey();
    for (final VirtualFile mergedFile : mergedFiles) {
        String path = FileUtil.toSystemDependentName(mergedFile.getPresentableUrl());
        conflictedGroup.remove(path);
        mergedGroup.add(path, vcsKey, null);
        mergedFile.refresh(false, false);
        // for additionally created files removal to be detected
        mergedFile.getParent().refresh(false, false);
        if (myChangesUnderProjectRoot) {
            myDirtyScopeManager.fileDirty(mergedFile);
        }
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) VcsKey(com.intellij.openapi.vcs.VcsKey) SvnMergeProvider(org.jetbrains.idea.svn.actions.SvnMergeProvider) AbstractVcsHelper(com.intellij.openapi.vcs.AbstractVcsHelper) FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Example 4 with FileGroup

use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.

the class UpdatedFilesProcessor method addFileMessage.

public void addFileMessage(FileMessage message) {
    String path = message.getFileAbsolutePath();
    VirtualFile virtualFile = getVirtualFileFor(path);
    final int messageType = message.getType();
    if (virtualFile != null && messageType == FileMessage.NOT_IN_REPOSITORY && FileTypeManager.getInstance().isFileIgnored(virtualFile)) {
        return;
    }
    FileGroup collection = getCollectionFor(messageType, virtualFile);
    LOG.assertTrue(collection != null, String.valueOf(messageType));
    final CvsRevisionNumber revision = message.getRevision();
    collection.add(path, CvsVcs2.getKey(), revision);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) FileGroup(com.intellij.openapi.vcs.update.FileGroup) CvsRevisionNumber(com.intellij.cvsSupport2.history.CvsRevisionNumber)

Example 5 with FileGroup

use of com.intellij.openapi.vcs.update.FileGroup in project intellij-community by JetBrains.

the class CvsUpdatePolicy method fillGroups.

public static void fillGroups(UpdatedFiles result) {
    result.registerGroup(new FileGroup(CvsBundle.message("update.status.unknown"), CvsBundle.message("update.status.unknown"), false, CvsUpdatePolicy.UNKNOWN_TYPE_ID, false));
    result.registerGroup(new FileGroup(CvsBundle.message("update.status.locally.modified.removed.from.server"), CvsBundle.message("update.status.locally.modified.removed.from.server"), false, CvsUpdatePolicy.MODIFIED_REMOVED_FROM_SERVER_ID, false));
    result.registerGroup(new FileGroup(CvsBundle.message("update.status.locally.removed.modified.on.server"), CvsBundle.message("update.status.locally.removed.modified.on.server"), false, CvsUpdatePolicy.LOCALLY_REMOVED_MODIFIED_ON_SERVER_ID, false));
    result.registerGroup(new FileGroup(CvsBundle.message("update.status.created.by.second.party"), CvsBundle.message("update.status.created.by.second.party"), true, CvsUpdatePolicy.CREATED_BY_SECOND_PARTY_ID, false));
    result.registerGroup(new FileGroup(CvsBundle.message("update.status.binary.file.has.to.be.merged"), CvsBundle.message("update.status.binary.file.has.to.be.merged"), false, CvsUpdatePolicy.BINARY_MERGED_ID, false));
}
Also used : FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Aggregations

FileGroup (com.intellij.openapi.vcs.update.FileGroup)9 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 VcsKey (com.intellij.openapi.vcs.VcsKey)2 CvsRevisionNumber (com.intellij.cvsSupport2.history.CvsRevisionNumber)1 Pair (com.intellij.openapi.util.Pair)1 AbstractVcsHelper (com.intellij.openapi.vcs.AbstractVcsHelper)1 VcsRevisionNumber (com.intellij.openapi.vcs.history.VcsRevisionNumber)1 SvnRevisionNumber (org.jetbrains.idea.svn.SvnRevisionNumber)1 SvnMergeProvider (org.jetbrains.idea.svn.actions.SvnMergeProvider)1