Search in sources :

Example 6 with FileGroup

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

the class ChangesCacheFile method processUpdatedFiles.

public boolean processUpdatedFiles(UpdatedFiles updatedFiles, Collection<CommittedChangeList> receivedChanges) throws IOException {
    boolean haveUnaccountedUpdatedFiles = false;
    openStreams();
    loadHeader();
    ReceivedChangeListTracker tracker = new ReceivedChangeListTracker();
    try {
        final List<IncomingChangeListData> incomingData = loadIncomingChangeListData();
        for (FileGroup group : updatedFiles.getTopLevelGroups()) {
            haveUnaccountedUpdatedFiles |= processGroup(group, incomingData, tracker);
        }
        if (!haveUnaccountedUpdatedFiles) {
            for (IncomingChangeListData data : incomingData) {
                saveIncoming(data, false);
            }
            writeHeader();
        }
    } finally {
        closeStreams();
    }
    receivedChanges.addAll(tracker.getChangeLists());
    return haveUnaccountedUpdatedFiles;
}
Also used : FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Example 7 with FileGroup

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

the class ChangesCacheFile method processGroup.

private boolean processGroup(final FileGroup group, final List<IncomingChangeListData> incomingData, final ReceivedChangeListTracker tracker) {
    boolean haveUnaccountedUpdatedFiles = false;
    final List<Pair<String, VcsRevisionNumber>> list = group.getFilesAndRevisions(myVcsManager);
    for (Pair<String, VcsRevisionNumber> pair : list) {
        final String file = pair.first;
        FilePath path = VcsUtil.getFilePath(file, false);
        if (!path.isUnder(myRootPath, false) || pair.second == null) {
            continue;
        }
        if (group.getId().equals(FileGroup.REMOVED_FROM_REPOSITORY_ID)) {
            haveUnaccountedUpdatedFiles |= processDeletedFile(path, incomingData, tracker);
        } else {
            haveUnaccountedUpdatedFiles |= processFile(path, pair.second, incomingData, tracker);
        }
    }
    for (FileGroup childGroup : group.getChildren()) {
        haveUnaccountedUpdatedFiles |= processGroup(childGroup, incomingData, tracker);
    }
    return haveUnaccountedUpdatedFiles;
}
Also used : VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber) FileGroup(com.intellij.openapi.vcs.update.FileGroup) Pair(com.intellij.openapi.util.Pair)

Example 8 with FileGroup

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

the class UpdateEventHandler method addFileToGroup.

protected void addFileToGroup(final String id, final ProgressEvent event) {
    final FileGroup fileGroup = myUpdatedFiles.getGroupById(id);
    final String path = event.getFile().getAbsolutePath();
    myFilesWaitingForRevision.peek().add(Pair.create(id, path));
    if (event.getErrorMessage() != null) {
        fileGroup.addError(path, event.getErrorMessage().getMessage());
    }
}
Also used : FileGroup(com.intellij.openapi.vcs.update.FileGroup)

Example 9 with FileGroup

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

the class MergeChangeCollector method addAll.

/**
   * Add all paths to the group
   */
private static void addAll(final UpdatedFiles updates, String group_id, Set<String> paths) {
    FileGroup fileGroup = updates.getGroupById(group_id);
    final VcsKey vcsKey = GitVcs.getKey();
    for (String path : paths) {
        fileGroup.add(path, vcsKey, null);
    }
}
Also used : VcsKey(com.intellij.openapi.vcs.VcsKey) 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