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);
}
Aggregations