mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Do not use SVNWCAccess despite working copy is 200% before-1.7 version and low-level access is needed
This commit is contained in:
@@ -129,6 +129,7 @@ public class RootsToWorkingCopies implements VcsListener {
|
||||
try {
|
||||
workingCopyRoot = SVNWCUtil.getWorkingCopyRoot(ioFile, true);
|
||||
if (workingCopyRoot != null) {
|
||||
// ok to use low-level 1.6 API, 1.7 is checked below
|
||||
SVNWCAccess wcAccess = SVNWCAccess.newInstance(null);
|
||||
try {
|
||||
wcAccess.probeOpen(workingCopyRoot, false, 0);
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package org.jetbrains.idea.svn;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
@@ -45,8 +46,6 @@ import org.jetbrains.idea.svn.dialogs.LockDialog;
|
||||
import org.tmatesoft.svn.core.*;
|
||||
import org.tmatesoft.svn.core.internal.util.SVNPathUtil;
|
||||
import org.tmatesoft.svn.core.internal.wc.SVNFileUtil;
|
||||
import org.tmatesoft.svn.core.internal.wc.admin.SVNEntry;
|
||||
import org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess;
|
||||
import org.tmatesoft.svn.core.internal.wc2.SvnWcGeneration;
|
||||
import org.tmatesoft.svn.core.io.SVNCapability;
|
||||
import org.tmatesoft.svn.core.io.SVNRepository;
|
||||
@@ -62,6 +61,7 @@ public class SvnUtil {
|
||||
@NonNls public static final String WC_DB_FILE_NAME = "wc.db";
|
||||
@NonNls public static final String DIR_PROPS_FILE_NAME = "dir-props";
|
||||
@NonNls public static final String PATH_TO_LOCK_FILE = SVN_ADMIN_DIR_NAME + "/lock";
|
||||
private static final Logger LOG = Logger.getInstance("#org.jetbrains.idea.svn.SvnUtil");
|
||||
|
||||
private SvnUtil() { }
|
||||
|
||||
@@ -583,23 +583,15 @@ public class SvnUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static SVNURL getUrl(final File file) {
|
||||
SVNWCAccess wcAccess = SVNWCAccess.newInstance(null);
|
||||
public static SVNURL getUrl(final SvnVcs vcs, final File file) {
|
||||
try {
|
||||
wcAccess.probeOpen(file, false, 0);
|
||||
SVNEntry entry = wcAccess.getVersionedEntry(file, false);
|
||||
return entry.getSVNURL();
|
||||
} catch (SVNException e) {
|
||||
//
|
||||
} finally {
|
||||
try {
|
||||
wcAccess.close();
|
||||
}
|
||||
catch (SVNException e) {
|
||||
//
|
||||
}
|
||||
final SVNInfo info = vcs.createWCClient().doInfo(file, SVNRevision.UNDEFINED);
|
||||
return info == null ? null : info.getURL(); // todo for moved items?
|
||||
}
|
||||
catch (SVNException e) {
|
||||
LOG.debug(e);
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean doesRepositorySupportMergeInfo(final SvnVcs vcs, final SVNURL url) {
|
||||
|
||||
@@ -91,7 +91,6 @@ import org.tmatesoft.svn.core.internal.util.jna.SVNJNAUtil;
|
||||
import org.tmatesoft.svn.core.internal.wc.SVNAdminUtil;
|
||||
import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea14;
|
||||
import org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory;
|
||||
import org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess;
|
||||
import org.tmatesoft.svn.core.io.SVNRepository;
|
||||
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
|
||||
import org.tmatesoft.svn.core.wc.*;
|
||||
@@ -734,12 +733,6 @@ public class SvnVcs extends AbstractVcs<CommittedChangeList> {
|
||||
return client;
|
||||
}
|
||||
|
||||
public SVNWCAccess createWCAccess() {
|
||||
final SVNWCAccess access = SVNWCAccess.newInstance(null);
|
||||
access.setOptions(myConfiguration.getOptions(myProject));
|
||||
return access;
|
||||
}
|
||||
|
||||
public ISVNOptions getSvnOptions() {
|
||||
return myConfiguration.getOptions(myProject);
|
||||
}
|
||||
@@ -1128,7 +1121,7 @@ public class SvnVcs extends AbstractVcs<CommittedChangeList> {
|
||||
final File ioFile = new File(vf.getPath());
|
||||
SVNURL url = mapping.getUrlForFile(ioFile);
|
||||
if (url == null) {
|
||||
url = SvnUtil.getUrl(ioFile);
|
||||
url = SvnUtil.getUrl(this, ioFile);
|
||||
if (url == null) {
|
||||
notMatched.add(s);
|
||||
continue;
|
||||
|
||||
@@ -223,7 +223,9 @@ public class CompareWithBranchAction extends AnAction implements DumbAware {
|
||||
}
|
||||
|
||||
private void report16DirDiff(SvnVcs vcs, SVNURL url) throws SVNException {
|
||||
SVNWCAccess wcAccess = vcs.createWCAccess();
|
||||
// here there's 1.6 copy so ok to use SVNWCAccess
|
||||
final SVNWCAccess wcAccess = SVNWCAccess.newInstance(null);
|
||||
wcAccess.setOptions(vcs.getSvnOptions());
|
||||
SVNRepository repository = null;
|
||||
SVNRepository repository2 = null;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user