mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SVN: wrong mapping was found
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
*/
|
||||
package org.jetbrains.idea.svn;
|
||||
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -90,7 +92,12 @@ public class SvnMapping {
|
||||
|
||||
@Nullable
|
||||
public String getRootForPath(final String path) {
|
||||
return myFile2UrlMap.floorKey(path);
|
||||
String floor = myFile2UrlMap.floorKey(path);
|
||||
NavigableMap<String, RootUrlInfo> head = myFile2UrlMap.headMap(floor, true);
|
||||
for (String root : head.descendingKeySet()) {
|
||||
if (startsWithForPaths(root, path)) return root;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Collection<String> getUrls() {
|
||||
@@ -133,4 +140,8 @@ public class SvnMapping {
|
||||
return FileUtil.comparePaths(o1, o2);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean startsWithForPaths(final String parent, final String child) {
|
||||
return SystemInfo.isFileSystemCaseSensitive ? child.startsWith(parent) : (StringUtil.startsWithIgnoreCase(child, parent));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user