Search in sources :

Example 1 with SvnWcGeneration

use of org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration in project intellij-community by JetBrains.

the class SvnUtil method getWcCopyRootIf17.

@Nullable
public static File getWcCopyRootIf17(final File file, @Nullable final File upperBound) {
    File current = getParentWithDb(file);
    if (current == null)
        return null;
    while (current != null) {
        try {
            final SvnWcGeneration svnWcGeneration = SvnOperationFactory.detectWcGeneration(current, false);
            if (SvnWcGeneration.V17.equals(svnWcGeneration))
                return current;
            if (SvnWcGeneration.V16.equals(svnWcGeneration))
                return null;
            if (upperBound != null && FileUtil.filesEqual(upperBound, current))
                return null;
            current = current.getParentFile();
        } catch (SVNException e) {
            return null;
        }
    }
    return null;
}
Also used : SvnWcGeneration(org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration) SVNException(org.tmatesoft.svn.core.SVNException) VirtualFile(com.intellij.openapi.vfs.VirtualFile) VfsUtilCore.virtualToIoFile(com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile) File(java.io.File) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

VfsUtilCore.virtualToIoFile (com.intellij.openapi.vfs.VfsUtilCore.virtualToIoFile)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 File (java.io.File)1 Nullable (org.jetbrains.annotations.Nullable)1 SVNException (org.tmatesoft.svn.core.SVNException)1 SvnWcGeneration (org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration)1