Search in sources :

Example 36 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class RevisionsAndDiffsTest method testIncludingCurrentVersionIntoRevisionsAfterPurge.

public void testIncludingCurrentVersionIntoRevisionsAfterPurge() throws Exception {
    Clock.setTime(10);
    VirtualFile f = createFile("file.txt", "content");
    loadContent(f);
    getVcs().getChangeListInTests().purgeObsolete(0);
    List<Revision> rr = getRevisionsFor(f);
    assertEquals(1, rr.size());
    Revision r = rr.get(0);
    assertNull(r.getLabel());
    assertNull(r.getChangeSetName());
    assertEquals(f.getTimeStamp(), r.getTimestamp());
    Entry e = r.findEntry();
    assertEquals("file.txt", e.getName());
    assertContent("content", e);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Entry(com.intellij.history.core.tree.Entry) Revision(com.intellij.history.core.revisions.Revision)

Example 37 with Entry

use of com.intellij.history.core.tree.Entry in project intellij-community by JetBrains.

the class RevisionsAndDiffsTest method testCurrentRevisionForDirectoryAfterPurge.

public void testCurrentRevisionForDirectoryAfterPurge() throws Exception {
    Clock.setTime(10);
    VirtualFile f = createDirectory("dir");
    getVcs().getChangeListInTests().purgeObsolete(0);
    List<Revision> rr = getRevisionsFor(f);
    assertEquals(1, rr.size());
    Revision r = rr.get(0);
    assertNull(r.getLabel());
    assertNull(r.getChangeSetName());
    // directory has no timestamp
    assertEquals(-1, r.getTimestamp());
    Entry e = r.findEntry();
    assertEquals("dir", e.getName());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Entry(com.intellij.history.core.tree.Entry) Revision(com.intellij.history.core.revisions.Revision)

Aggregations

Entry (com.intellij.history.core.tree.Entry)37 RootEntry (com.intellij.history.core.tree.RootEntry)25 FileEntry (com.intellij.history.core.tree.FileEntry)12 Test (org.junit.Test)12 DirectoryEntry (com.intellij.history.core.tree.DirectoryEntry)11 VirtualFile (com.intellij.openapi.vfs.VirtualFile)7 Revision (com.intellij.history.core.revisions.Revision)5 StoredContent (com.intellij.history.core.StoredContent)4 Difference (com.intellij.history.core.revisions.Difference)3 NewVirtualFile (com.intellij.openapi.vfs.newvfs.NewVirtualFile)2 ByteContent (com.intellij.history.ByteContent)1 Content (com.intellij.history.core.Content)1 Change (com.intellij.history.core.changes.Change)1 DeleteChange (com.intellij.history.core.changes.DeleteChange)1 StructuralChange (com.intellij.history.core.changes.StructuralChange)1 SelectionCalculator (com.intellij.history.integration.ui.models.SelectionCalculator)1 VirtualFileSystemEntry (com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry)1 THashSet (gnu.trove.THashSet)1 ArrayList (java.util.ArrayList)1 LinkedHashSet (java.util.LinkedHashSet)1