Search in sources :

Example 1 with AlienDirtyScope

use of org.jetbrains.idea.svn.integrate.AlienDirtyScope 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");
    runAndVerifyStatus("A child", "A child" + File.separatorChar + "a.txt");
    checkin();
    deleteFileInCommand(dir);
    runAndVerifyStatus("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());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList) Change(com.intellij.openapi.vcs.changes.Change) ChangeListManager(com.intellij.openapi.vcs.changes.ChangeListManager) AlienDirtyScope(org.jetbrains.idea.svn.integrate.AlienDirtyScope) Test(org.junit.Test)

Example 2 with AlienDirtyScope

use of org.jetbrains.idea.svn.integrate.AlienDirtyScope 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());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList) Change(com.intellij.openapi.vcs.changes.Change) ChangeListManager(com.intellij.openapi.vcs.changes.ChangeListManager) AlienDirtyScope(org.jetbrains.idea.svn.integrate.AlienDirtyScope) Test(org.junit.Test)

Aggregations

Change (com.intellij.openapi.vcs.changes.Change)2 ChangeListManager (com.intellij.openapi.vcs.changes.ChangeListManager)2 LocalChangeList (com.intellij.openapi.vcs.changes.LocalChangeList)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 AlienDirtyScope (org.jetbrains.idea.svn.integrate.AlienDirtyScope)2 Test (org.junit.Test)2