Search in sources :

Example 1 with AllVcsesI

use of com.intellij.openapi.vcs.impl.projectlevelman.AllVcsesI in project intellij-community by JetBrains.

the class LocalChangesUnderRootsTest method testChangesInTwoGitRoots.

public void testChangesInTwoGitRoots() {
    AllVcsesI myVcses = AllVcses.getInstance(myProject);
    myVcses.registerManually(new MockAbstractVcs(myProject, "Mock"));
    List<VirtualFile> roots = createRootStructure(Pair.create(myBaseDir.getPath(), "Mock"), Pair.create("community", "Mock"));
    Change changeBeforeCommunity = createChangeForPath("a.txt");
    Change changeAfterCommunity = createChangeForPath("readme.txt");
    Change changeInCommunity = createChangeForPath("community/com.txt");
    myChangeListManager.addChanges(changeBeforeCommunity, changeAfterCommunity, changeInCommunity);
    Map<VirtualFile, Collection<Change>> expected = new HashMap<>();
    expected.put(roots.get(0), Arrays.asList(changeBeforeCommunity, changeAfterCommunity));
    expected.put(roots.get(1), Collections.singletonList(changeInCommunity));
    Map<VirtualFile, Collection<Change>> changesUnderRoots = myLocalChangesUnderRoots.getChangesUnderRoots(roots);
    assertEqualMaps(expected, changesUnderRoots);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) MockAbstractVcs(com.intellij.openapi.vcs.changes.committed.MockAbstractVcs) Change(com.intellij.openapi.vcs.changes.Change) AllVcsesI(com.intellij.openapi.vcs.impl.projectlevelman.AllVcsesI)

Aggregations

Change (com.intellij.openapi.vcs.changes.Change)1 MockAbstractVcs (com.intellij.openapi.vcs.changes.committed.MockAbstractVcs)1 AllVcsesI (com.intellij.openapi.vcs.impl.projectlevelman.AllVcsesI)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1