VcsDirtyScopeImpl () { VcsDirtyScopeImpl copy = new VcsDirtyScopeImpl(myVcs); copy.myWasEverythingDirty = myWasEverythingDirty; for (VirtualFile root : myAffectedVcsRoots) { RecursiveFilePathSet rootDirs = myDirtyDirectoriesRecursively.get(root); Set<FilePath> rootFiles = ContainerUtil.notNullize(myDirtyFiles.get(root)); RecursiveFilePathSet filteredDirs = removeAncestorsRecursive(rootDirs); Set<FilePath> filteredFiles = removeAncestorsNonRecursive(filteredDirs, rootFiles); copy.myAffectedVcsRoots.add(root); copy.myDirtyDirectoriesRecursively.put(root, filteredDirs); copy.myDirtyFiles.put(root, filteredFiles); } return copy; }