Subversion: do NOT listen to wc.db changes - if -Dsvn.do.not.listen.to.wc.db=true

needed to check assumption that checksum mismatch problem occurs if writing transaction receives BUSY exception during commit (this is phase-of-the-moon *bug* in svnkit)

IDEA-97081 OSX / svn commit failed - Base checksum mismatch
IDEA-100494 Cannot make a SVN commit via Intellij
IDEA-98435 Can not commit to SVN
This commit is contained in:
irengrig
2013-02-14 15:05:55 +04:00
parent a4b6c3ff9f
commit 5d2c2e4f6d
3 changed files with 7 additions and 1 deletions
@@ -120,6 +120,7 @@ public class SvnChangeProvider implements ChangeProvider {
}
private static void putAdministrative17UnderVfsListener(Set<NestedCopiesBuilder.MyPointInfo> pointInfos) {
if (! SvnVcs.ourListenToWcDb) return;
final LocalFileSystem lfs = LocalFileSystem.getInstance();
for (NestedCopiesBuilder.MyPointInfo info : pointInfos) {
if (WorkingCopyFormat.ONE_DOT_SEVEN.equals(info.getFormat()) && ! NestedCopyType.switched.equals(info.getType())) {
@@ -61,7 +61,7 @@ public class SvnEntriesFileListener extends VirtualFileAdapter {
return;
}
final VirtualFile file = event.getFile();
if (isWcDbFile(file)) {
if (isWcDbFile(file) && SvnVcs.ourListenToWcDb) {
LOG.debug("wc.db had changed");
final VirtualFile parentWcDb = file.getParent();
if (parentWcDb != null && SvnUtil.isAdminDirectory(parentWcDb)) {
@@ -108,8 +108,10 @@ import java.util.logging.Level;
@SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"})
public class SvnVcs extends AbstractVcs<CommittedChangeList> {
private static final String DO_NOT_LISTEN_TO_WC_DB = "svn.do.not.listen.to.wc.db";
private static final String KEEP_CONNECTIONS_KEY = "svn.keep.connections";
private static final Logger REFRESH_LOG = Logger.getInstance("#svn_refresh");
public static boolean ourListenToWcDb = true;
private static final int ourLogUsualInterval = 20 * 1000;
private static final int ourLogRareInterval = 30 * 1000;
@@ -197,6 +199,9 @@ public class SvnVcs extends AbstractVcs<CommittedChangeList> {
static {
System.setProperty("svnkit.log.native.calls", "true");
if (Boolean.getBoolean(DO_NOT_LISTEN_TO_WC_DB)) {
ourListenToWcDb = false;
}
final JavaSVNDebugLogger logger = new JavaSVNDebugLogger(Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
SVNDebugLog.setDefaultLog(logger);