use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnConcurrentChangeListManagerTest method testRemove.
@Test
public void testRemove() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final VirtualFile fileB = createFileInCommand("b.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) });
myScheme.doTest(() -> {
changeListManager.removeChangeList(list.getName());
assert changeListManager.findChangeList(list.getName()) == null;
checkFilesAreInList(new VirtualFile[] { file, fileB }, myDefaulListName, changeListManager);
});
assert changeListManager.findChangeList(list.getName()) == null;
checkFilesAreInList(new VirtualFile[] { file, fileB }, myDefaulListName, changeListManager);
changeListManager.ensureUpToDate(false);
assert changeListManager.findChangeList(list.getName()) == null;
checkFilesAreInList(new VirtualFile[] { file, fileB }, myDefaulListName, changeListManager);
}
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 testAddListBySvn.
@Test
public void testAddListBySvn() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final VirtualFile file = createFileInCommand("a.txt", "old content");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
final String targetName = "target";
// not parralel, just test of correct detection
runInAndVerifyIgnoreOutput("changelist", targetName, file.getPath());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
changeListManager.ensureUpToDate(false);
checkFilesAreInList(new VirtualFile[] { file }, targetName, 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);
}
use of com.intellij.openapi.vcs.changes.ChangeListManager in project intellij-community by JetBrains.
the class SvnDeleteTest method testDeletePackage.
// IDEADEV-16066
@Test
public void testDeletePackage() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
VirtualFile dir = createDirInCommand(myWorkingCopyDir, "child");
createFileInCommand(dir, "a.txt", "content");
runAndVerifyStatusSorted("A child", "A child" + File.separatorChar + "a.txt");
checkin();
deleteFileInCommand(dir);
runAndVerifyStatusSorted("D child", "D child" + File.separatorChar + "a.txt");
refreshVfs();
final AlienDirtyScope dirtyScope = new AlienDirtyScope();
dirtyScope.addDir(VcsUtil.getFilePath(myWorkingCopyDir));
final List<Change> changesManually = getChangesInScope(dirtyScope);
Assert.assertEquals(2, changesManually.size());
VcsDirtyScopeManager.getInstance(myProject).markEverythingDirty();
// since ChangeListManager is runnning, it can take dirty scope itself;... it's easier to just take changes from it
final ChangeListManager clManager = ChangeListManager.getInstance(myProject);
clManager.ensureUpToDate(false);
final List<LocalChangeList> lists = clManager.getChangeListsCopy();
Assert.assertEquals(1, lists.size());
final Collection<Change> changes = lists.get(0).getChanges();
Assert.assertEquals(2, changes.size());
}
Aggregations