use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testDoubleMove.
@Test
public void testDoubleMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
final LocalChangeList target2 = changeListManager.addChangeList("target2", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.moveChangesTo(target, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
changeListManager.moveChangesTo(target2, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, target2.getName(), changeListManager);
}
use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testMove.
@Test
public void testMove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.moveChangesTo(target, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
}
use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testSetActive.
@Test
public void testSetActive() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.setDefaultChangeList(target);
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
});
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
changeListManager.ensureUpToDate(false);
assert changeListManager.getDefaultChangeList().getName().equals(target.getName());
}
use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testRenameList.
@Test
public void testRenameList() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
final String newName = "renamed";
myScheme.doTest(() -> {
changeListManager.editName(list.getName(), newName);
checkFilesAreInList(new VirtualFile[] { file }, newName, changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, newName, changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, newName, changeListManager);
}
use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testDoubleMoveBack.
@Test
public void testDoubleMoveBack() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final LocalChangeList list = changeListManager.addChangeList("test", null);
final LocalChangeList target = changeListManager.addChangeList("target", null);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
myScheme.doTest(() -> {
changeListManager.moveChangesTo(target, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, target.getName(), changeListManager);
changeListManager.moveChangesTo(list, new Change[] { changeListManager.getChange(file) });
checkFilesAreInList(new VirtualFile[] { file }, list.getName(), changeListManager);
});
checkFilesAreInList(new VirtualFile[] { file }, list.getName(), changeListManager);
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, list.getName(), changeListManager);
}
Aggregations