From a85cde815b3b0f319f813957d9f28bfef2412504 Mon Sep 17 00:00:00 2001 From: clickjohndahl Date: Mon, 20 Mar 2017 18:15:12 +0545 Subject: [PATCH 1/2] Update UpdateUpdater.java Fail build when locked file instead of fresh check out. This is helpful when repositories are very large and takes hours for fresh check out which flushes configurations as well. --- src/main/java/hudson/scm/subversion/UpdateUpdater.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/hudson/scm/subversion/UpdateUpdater.java b/src/main/java/hudson/scm/subversion/UpdateUpdater.java index f00ebdb29..3b06ebdc1 100755 --- a/src/main/java/hudson/scm/subversion/UpdateUpdater.java +++ b/src/main/java/hudson/scm/subversion/UpdateUpdater.java @@ -178,8 +178,12 @@ public List perform() throws IOException, InterruptedException { SVNErrorCode errorCode = cause.getErrorMessage().getErrorCode(); if (errorCode == SVNErrorCode.WC_LOCKED) { // work space locked. try fresh check out - listener.getLogger().println("Workspace appear to be locked, so getting a fresh workspace"); - return delegateTo(new CheckoutUpdater()); + //listener.getLogger().println("Workspace appear to be locked, so getting a fresh workspace"); + //return delegateTo(new CheckoutUpdater()); + + //show error instead of check out, useful for big repositories + listener.getLogger().println("Workspace appear to be locked, so Failing the build"); ++ throw (InterruptedException) new InterruptedException().initCause(e); } if (errorCode == SVNErrorCode.WC_OBSTRUCTED_UPDATE) { // HUDSON-1882. If existence of local files cause an update to fail, From 66288b56db73ebfed9fd05b4bc0ee46ad1909c93 Mon Sep 17 00:00:00 2001 From: clickjohndahl Date: Mon, 20 Mar 2017 18:25:29 +0545 Subject: [PATCH 2/2] Removed extra plus sign. --- src/main/java/hudson/scm/subversion/UpdateUpdater.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/hudson/scm/subversion/UpdateUpdater.java b/src/main/java/hudson/scm/subversion/UpdateUpdater.java index 3b06ebdc1..e63df6192 100755 --- a/src/main/java/hudson/scm/subversion/UpdateUpdater.java +++ b/src/main/java/hudson/scm/subversion/UpdateUpdater.java @@ -183,7 +183,7 @@ public List perform() throws IOException, InterruptedException { //show error instead of check out, useful for big repositories listener.getLogger().println("Workspace appear to be locked, so Failing the build"); -+ throw (InterruptedException) new InterruptedException().initCause(e); + throw (InterruptedException) new InterruptedException().initCause(e); } if (errorCode == SVNErrorCode.WC_OBSTRUCTED_UPDATE) { // HUDSON-1882. If existence of local files cause an update to fail,