Search in sources :

Example 1 with CurrentBinaryContentRevision

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

the class ShelvedBinaryFile method createChange.

public Change createChange(final Project project) {
    ContentRevision before = null;
    ContentRevision after = null;
    final File baseDir = new File(project.getBaseDir().getPath());
    if (BEFORE_PATH != null) {
        final FilePath file = VcsUtil.getFilePath(new File(baseDir, BEFORE_PATH), false);
        before = new CurrentBinaryContentRevision(file) {

            @NotNull
            @Override
            public VcsRevisionNumber getRevisionNumber() {
                return new TextRevisionNumber(VcsBundle.message("local.version.title"));
            }
        };
    }
    if (AFTER_PATH != null) {
        final FilePath file = VcsUtil.getFilePath(new File(baseDir, AFTER_PATH), false);
        after = new ShelvedBinaryContentRevision(file, SHELVED_PATH);
    }
    return new Change(before, after);
}
Also used : FilePath(com.intellij.openapi.vcs.FilePath) TextRevisionNumber(com.intellij.openapi.vcs.changes.TextRevisionNumber) VcsRevisionNumber(com.intellij.openapi.vcs.history.VcsRevisionNumber) ContentRevision(com.intellij.openapi.vcs.changes.ContentRevision) CurrentBinaryContentRevision(com.intellij.openapi.vcs.changes.CurrentBinaryContentRevision) CurrentBinaryContentRevision(com.intellij.openapi.vcs.changes.CurrentBinaryContentRevision) Change(com.intellij.openapi.vcs.changes.Change) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

FilePath (com.intellij.openapi.vcs.FilePath)1 Change (com.intellij.openapi.vcs.changes.Change)1 ContentRevision (com.intellij.openapi.vcs.changes.ContentRevision)1 CurrentBinaryContentRevision (com.intellij.openapi.vcs.changes.CurrentBinaryContentRevision)1 TextRevisionNumber (com.intellij.openapi.vcs.changes.TextRevisionNumber)1 VcsRevisionNumber (com.intellij.openapi.vcs.history.VcsRevisionNumber)1 File (java.io.File)1 NotNull (org.jetbrains.annotations.NotNull)1