p4: restore support for <Project> mappings

Perforce roots can't be detected using simple `VcsRootChecker` and have no 'administrative pattern'.
Instead `P4ConnectionCalculator` detects roots and filters them with `RootsConvertor`.
This logic expects `MappingsToRoots` to return all roots from `DefaultVcsRootPolicy`,
without additional filtering by `DefaultVcsRootChecker`.

This fix inherits all issues of old implementation.
A better solution would be to use `P4ConnectionCalculator` instead of
generic root detection/validation logic in `NewMappings`.

Fix regression after f3b725b51c3d09882680ced5f71ab52c75ba9c2d

GitOrigin-RevId: 35d6ea3c76a5d851d40fa28bfab9fc3c2b0ca828
This commit is contained in:
Aleksey Pivovarov
2019-05-20 20:19:05 +03:00
committed by intellij-monorepo-bot
parent 0f56a0faaa
commit 84bb2e6556
3 changed files with 9 additions and 4 deletions
@@ -15,5 +15,6 @@
<orderEntry type="library" name="StreamEx" level="project" />
<orderEntry type="library" name="JDOM" level="project" />
<orderEntry type="library" name="kotlin-stdlib-jdk8" level="project" />
<orderEntry type="module" module-name="intellij.platform.util" />
</component>
</module>
@@ -22,10 +22,7 @@ import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ThreeState;
import com.intellij.util.ui.VcsSynchronousProgressWrapper;
import org.jetbrains.annotations.CalledInAwt;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.*;
import java.util.Collections;
import java.util.List;
@@ -428,6 +425,11 @@ public abstract class AbstractVcs<ComList extends CommittedChangeList> extends S
List<VirtualFile> convertRoots(@NotNull List<VirtualFile> result);
}
@ApiStatus.Internal
public boolean needsLegacyDefaultMappings() {
return false;
}
/**
* Returns the implementation of the merge provider which is used to load the revisions to be merged
* for a particular file.
@@ -293,6 +293,8 @@ public class NewMappings implements Disposable {
@NotNull Collection<VirtualFile> projectRoots,
@NotNull Set<VirtualFile> mappedDirs) {
try {
if (vcs.needsLegacyDefaultMappings()) return projectRoots;
DirectoryIndex directoryIndex = DirectoryIndex.getInstance(myProject);
VcsRootChecker rootChecker = myVcsManager.getRootChecker(vcs);