use of com.intellij.history.core.revisions.RecentChange in project intellij-community by JetBrains.
the class RecentChangeDialogTest method testDialogWork.
public void testDialogWork() throws IOException {
getVcs().beginChangeSet();
createChildData(myRoot, "f.txt");
getVcs().endChangeSet("change");
RecentChange c = getVcs().getRecentChanges(getRootEntry()).get(0);
RecentChangeDialog d = null;
try {
d = new RecentChangeDialog(myProject, myGateway, c);
} finally {
if (d != null) {
Disposer.dispose(d);
}
}
}
use of com.intellij.history.core.revisions.RecentChange in project intellij-community by JetBrains.
the class LocalVcsRecentChangesTest method testDoesNotIncludeUnnamedChanges.
@Test
public void testDoesNotIncludeUnnamedChanges() {
vcs.beginChangeSet();
add(vcs, createFile(root, "f1"));
vcs.endChangeSet("a");
add(vcs, createFile(root, "f2"));
vcs.beginChangeSet();
add(vcs, createFile(root, "f3"));
vcs.endChangeSet("b");
List<RecentChange> cc = vcs.getRecentChanges(root);
assertRecentChanges(cc, "b", "a");
RecentChange c0 = cc.get(0);
RecentChange c1 = cc.get(1);
assertNotNull(findEntryAfter(c0, "f1"));
assertNotNull(findEntryAfter(c0, "f2"));
assertNotNull(findEntryAfter(c0, "f3"));
assertNotNull(findEntryBefore(c0, "f1"));
assertNotNull(findEntryBefore(c0, "f2"));
assertNull(findEntryBefore(c0, "f3"));
assertNotNull(findEntryAfter(c1, "f1"));
assertNull(findEntryAfter(c1, "f2"));
assertNull(findEntryAfter(c1, "f3"));
assertNull(findEntryBefore(c1, "f1"));
assertNull(findEntryBefore(c1, "f2"));
assertNull(findEntryBefore(c1, "f3"));
}
use of com.intellij.history.core.revisions.RecentChange 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.RecentChange in project intellij-community by JetBrains.
the class LocalVcsRecentChangesTest method testRecentChanges.
@Test
public void testRecentChanges() {
vcs.beginChangeSet();
add(vcs, createFile(root, "f1"));
vcs.endChangeSet("a");
vcs.beginChangeSet();
add(vcs, createFile(root, "f2"));
vcs.endChangeSet("b");
List<RecentChange> cc = vcs.getRecentChanges(root);
assertRecentChanges(cc, "b", "a");
RecentChange c0 = cc.get(0);
RecentChange c1 = cc.get(1);
assertNotNull(findEntryAfter(c0, "f1"));
assertNotNull(findEntryAfter(c0, "f2"));
assertNotNull(findEntryBefore(c0, "f1"));
assertNull(findEntryBefore(c0, "f2"));
assertNotNull(findEntryAfter(c1, "f1"));
assertNull(findEntryAfter(c1, "f2"));
assertNull(findEntryBefore(c1, "f1"));
assertNull(findEntryBefore(c1, "f2"));
}
use of com.intellij.history.core.revisions.RecentChange in project intellij-community by JetBrains.
the class RecentChangeDialogTest method testRevertChange.
public void testRevertChange() throws IOException {
getVcs().beginChangeSet();
createChildData(myRoot, "f1.txt");
getVcs().endChangeSet("change");
getVcs().beginChangeSet();
createChildData(myRoot, "f2.txt");
getVcs().endChangeSet("another change");
RecentChange c = getVcs().getRecentChanges(getRootEntry()).get(1);
RecentChangeDialogModel m = new RecentChangeDialogModel(myProject, myGateway, getVcs(), c);
Reverter r = m.createReverter();
r.revert();
assertNull(myRoot.findChild("f1.txt"));
assertNotNull(myRoot.findChild("f2.txt"));
}
Aggregations