Search in sources :

Example 1 with SimpleContentRevision

use of com.intellij.openapi.vcs.changes.SimpleContentRevision in project intellij-community by JetBrains.

the class TextFilePatchInProgress method getNewContentRevision.

public ContentRevision getNewContentRevision() {
    if (FilePatchStatus.DELETED.equals(myStatus))
        return null;
    if (myNewContentRevision == null) {
        myConflicts = null;
        if (FilePatchStatus.ADDED.equals(myStatus)) {
            final FilePath newFilePath = VcsUtil.getFilePath(myIoCurrentBase, false);
            final String content = myPatch.getNewFileText();
            myNewContentRevision = new SimpleContentRevision(content, newFilePath, myPatch.getAfterVersionId());
        } else {
            final FilePath newFilePath = detectNewFilePathForMovedOrModified();
            myNewContentRevision = new LazyPatchContentRevision(myCurrentBase, newFilePath, myPatch.getAfterVersionId(), myPatch);
            if (myCurrentBase != null) {
                ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {

                    public void run() {
                        ((LazyPatchContentRevision) myNewContentRevision).getContent();
                    }
                });
            }
        }
    }
    return myNewContentRevision;
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) SimpleContentRevision(com.intellij.openapi.vcs.changes.SimpleContentRevision)

Aggregations

FilePath (com.intellij.openapi.vcs.FilePath)1 SimpleContentRevision (com.intellij.openapi.vcs.changes.SimpleContentRevision)1