diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn17/SvnAuthenticationNotifier.java b/plugins/svn4idea/src/org/jetbrains/idea/svn17/SvnAuthenticationNotifier.java index 95edf056f9f5..a494e24a237b 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn17/SvnAuthenticationNotifier.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn17/SvnAuthenticationNotifier.java @@ -18,7 +18,9 @@ package org.jetbrains.idea.svn17; import com.intellij.notification.NotificationType; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; +import com.intellij.openapi.application.ex.ApplicationEx; import com.intellij.openapi.diagnostic.Logger; +import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.MessageType; import com.intellij.openapi.ui.popup.Balloon; @@ -95,7 +97,7 @@ public class SvnAuthenticationNotifier extends GenericNotifierImpl resultRef = new Ref(); - ApplicationManager.getApplication().executeOnPooledThread(new Runnable() { + final Runnable checker = new Runnable() { @Override public void run() { try { @@ -106,11 +108,20 @@ public class SvnAuthenticationNotifier extends GenericNotifierImpl { myAuthManager = new SvnAuthenticationManager(myProject, new File(getConfigurationDirectory())); getInteractiveManager(svnVcs); // to init - myAuthManager.setAuthenticationProvider(new SvnAuthenticationProvider(svnVcs, myInteractiveProvider)); + myAuthManager.setAuthenticationProvider(new SvnAuthenticationProvider(svnVcs, myInteractiveProvider, RUNTIME_AUTH_CACHE)); myAuthManager.setRuntimeStorage(RUNTIME_AUTH_CACHE); } return myAuthManager; diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/SvnAuthenticationProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/SvnAuthenticationProvider.java index 4d4ff41ec12b..44a35487ccee 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/SvnAuthenticationProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn17/dialogs/SvnAuthenticationProvider.java @@ -27,6 +27,7 @@ import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider; import org.tmatesoft.svn.core.auth.SVNAuthentication; import org.tmatesoft.svn.core.auth.SVNUserNameAuthentication; +import org.tmatesoft.svn.core.internal.wc.ISVNAuthenticationStorage; import java.util.HashSet; import java.util.Set; @@ -39,9 +40,12 @@ public class SvnAuthenticationProvider implements ISVNAuthenticationProvider { private final Project myProject; private final SvnAuthenticationNotifier myAuthenticationNotifier; private final ISVNAuthenticationProvider mySvnInteractiveAuthenticationProvider; + private final ISVNAuthenticationStorage myAuthenticationStorage; private static final Set ourForceInteractive = new HashSet(); - public SvnAuthenticationProvider(final SvnVcs17 svnVcs, final ISVNAuthenticationProvider provider) { + public SvnAuthenticationProvider(final SvnVcs17 svnVcs, final ISVNAuthenticationProvider provider, + final ISVNAuthenticationStorage authenticationStorage) { + myAuthenticationStorage = authenticationStorage; myProject = svnVcs.getProject(); myAuthenticationNotifier = svnVcs.getAuthNotifier(); mySvnInteractiveAuthenticationProvider = provider; @@ -68,7 +72,9 @@ public class SvnAuthenticationProvider implements ISVNAuthenticationProvider { // outside-project url return mySvnInteractiveAuthenticationProvider.requestClientAuthentication(kind, url, realm, errorMessage, previousAuth, authMayBeStored); } else { - myAuthenticationNotifier.ensureNotify(obj); + if (myAuthenticationNotifier.ensureNotify(obj)) { + return (SVNAuthentication) myAuthenticationStorage.getData(kind, realm); + } } return null; } diff --git a/plugins/svn4idea/testSource/org/jetbrains/idea/svn17/SvnAuthenticationTest.java b/plugins/svn4idea/testSource/org/jetbrains/idea/svn17/SvnAuthenticationTest.java index f7cc6ca95760..86bc1b019921 100644 --- a/plugins/svn4idea/testSource/org/jetbrains/idea/svn17/SvnAuthenticationTest.java +++ b/plugins/svn4idea/testSource/org/jetbrains/idea/svn17/SvnAuthenticationTest.java @@ -80,7 +80,7 @@ public class SvnAuthenticationTest extends PlatformTestCase { myAuthenticationManager = new SvnAuthenticationManager(myProject, configFile); myInteractiveProvider = new SvnTestInteractiveAuthentication(myAuthenticationManager); - myAuthenticationManager.setAuthenticationProvider(new SvnAuthenticationProvider(vcs, myInteractiveProvider)); + myAuthenticationManager.setAuthenticationProvider(new SvnAuthenticationProvider(vcs, myInteractiveProvider, SvnConfiguration17.RUNTIME_AUTH_CACHE)); myAuthenticationManager.setRuntimeStorage(SvnConfiguration17.RUNTIME_AUTH_CACHE); myTestInteraction = new TestInteraction();