From 0645f01bc0f44c664f3c458bda4bd4fa81d1294d Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Tue, 12 Nov 2013 23:49:44 +0400 Subject: [PATCH] svn: Force checking if command was cancelled before repeating it once again (in case some auth failure) --- .../org/jetbrains/idea/svn/commandLine/CommandExecutor.java | 6 +----- .../org/jetbrains/idea/svn/commandLine/CommandRuntime.java | 5 ++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java index 77b5f29280a7..e401ab26fd12 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandExecutor.java @@ -205,7 +205,7 @@ public class CommandExecutor { } } - private boolean checkCancelled() { + public boolean checkCancelled() { if (!myWasCancelled && myCommand.getCanceller() != null) { try { myCommand.getCanceller().checkCancelled(); @@ -219,10 +219,6 @@ public class CommandExecutor { return myWasCancelled; } - public boolean wasCancelled() { - return myWasCancelled; - } - public void destroyProcess() { synchronized (myLock) { myNeedsDestroy = true; diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java index cf82da3c545a..7d79433d5aed 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/commandLine/CommandRuntime.java @@ -106,7 +106,10 @@ public class CommandRuntime { final String errText = executor.getErrorOutput().trim(); final AuthCallbackCase callback = executor instanceof TerminalExecutor ? null : createCallback(errText, command.getRepositoryUrl()); // do not handle possible authentication errors if command was manually cancelled - if (!executor.wasCancelled() && callback != null) { + // force checking if command is cancelled and not just use corresponding value from executor - as there could be cases when command + // finishes quickly but with some auth error - this way checkCancelled() is not called by executor itself and so command is repeated + // "infinite" times despite it was cancelled. + if (!executor.checkCancelled() && callback != null) { if (callback.getCredentials(errText)) { if (myAuthCallback.getSpecialConfigDir() != null) { command.setConfigDir(myAuthCallback.getSpecialConfigDir());