From 2e243b88411a3ca7453ed047dff280c2a9c4a7e3 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 19 May 2008 22:34:11 +0000 Subject: [PATCH] if the workspace is locked, wipe out and retry. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9456 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/scm/SubversionSCM.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/scm/SubversionSCM.java b/core/src/main/java/hudson/scm/SubversionSCM.java index fa87f81ebf..001103fb0d 100644 --- a/core/src/main/java/hudson/scm/SubversionSCM.java +++ b/core/src/main/java/hudson/scm/SubversionSCM.java @@ -356,7 +356,7 @@ public class SubversionSCM extends SCM implements Serializable { private final ISVNAuthenticationProvider authProvider; private final Date timestamp; // true to "svn update", false to "svn checkout". - private final boolean update; + private boolean update; private final TaskListener listener; private final ModuleLocation[] locations; @@ -383,6 +383,13 @@ public class SubversionSCM extends SCM implements Serializable { svnuc.doUpdate(new File(ws, l.local).getCanonicalFile(), revision, true); } catch (final SVNException e) { + if(e.getErrorMessage().getErrorCode()== SVNErrorCode.WC_LOCKED) { + // work space locked. try fresh check out + listener.getLogger().println("Workspace appear to be locked, so getting a fresh workspace"); + update = false; + return invoke(ws,channel); + } + e.printStackTrace(listener.error("Failed to update "+l.remote)); // trouble-shooting probe for #591 if(e.getErrorMessage().getErrorCode()== SVNErrorCode.WC_NOT_LOCKED) {