use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class LocalHistoryFacade method getRecentChanges.
public List<RecentChange> getRecentChanges(RootEntry root) {
List<RecentChange> result = new ArrayList<>();
for (ChangeSet c : myChangeList.iterChanges()) {
if (c.isContentChangeOnly())
continue;
if (c.isLabelOnly())
continue;
if (c.getName() == null)
continue;
Revision before = new ChangeRevision(this, root, "", c, true);
Revision after = new ChangeRevision(this, root, "", c, false);
result.add(new RecentChange(before, after));
if (result.size() >= 20)
break;
}
return result;
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class BasicsTest method testDoNotRegisterSameUnsavedDocumentContentTwice.
public void testDoNotRegisterSameUnsavedDocumentContentTwice() throws Exception {
VirtualFile f = createChildData(myRoot, "f.txt");
setContent(f, "1");
setDocumentTextFor(f, "2");
LocalHistory.getInstance().putSystemLabel(myProject, "label");
LocalHistory.getInstance().putUserLabel(myProject, "label");
List<Revision> rr = getRevisionsFor(f);
// 3 changes + 2 labels
assertEquals(6, rr.size());
assertEquals("2", new String(rr.get(0).findEntry().getContent().getBytes()));
assertEquals("2", new String(rr.get(1).findEntry().getContent().getBytes()));
assertEquals("2", new String(rr.get(2).findEntry().getContent().getBytes()));
assertEquals("1", new String(rr.get(3).findEntry().getContent().getBytes()));
assertEquals("", new String(rr.get(4).findEntry().getContent().getBytes()));
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class ExternalChangesAndRefreshingTest method testChangeSetName.
public void testChangeSetName() throws Exception {
createFileExternally("f.txt");
refreshVFS();
Revision r = getRevisionsFor(myRoot).get(1);
assertEquals("External change", r.getChangeSetName());
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class FileListeningTest method testCreationAndDeletionOfFileUnderUnversionedDir.
public void testCreationAndDeletionOfFileUnderUnversionedDir() throws IOException {
addExcludedDir(myRoot.getPath() + "/dir");
Module m = createModule("foo");
addContentRoot(m, myRoot.getPath() + "/dir/subDir");
createFileExternally("dir/subDir/file.txt");
LocalFileSystem.getInstance().refresh(false);
FileUtil.delete(new File(myRoot.getPath() + "/dir/subDir"));
LocalFileSystem.getInstance().refresh(false);
createFileExternally("dir/subDir/file.txt");
LocalFileSystem.getInstance().refresh(false);
List<Revision> revs = getRevisionsFor(myRoot);
assertEquals(4, revs.size());
assertNotNull(revs.get(0).findEntry().findEntry("dir/subDir/file.txt"));
assertNull(revs.get(1).findEntry().findEntry("dir/subDir"));
assertNotNull(revs.get(2).findEntry().findEntry("dir/subDir/file.txt"));
assertNull(revs.get(3).findEntry().findEntry("dir/subDir"));
}
use of com.intellij.history.core.revisions.Revision in project intellij-community by JetBrains.
the class SelectionReverterTest method createReverter.
private SelectionReverter createReverter(int from, int to) {
List<Revision> rr = getRevisionsFor(f);
SelectionCalculator c = new SelectionCalculator(myGateway, rr, from, to);
Revision leftRev = rr.get(1);
Entry entry = getRootEntry().getEntry(f.getPath());
return new SelectionReverter(myProject, getVcs(), myGateway, c, leftRev, entry, from, to);
}
Aggregations