From 404ff58b81ed2c373f99e8e755f00c6e51010b4d Mon Sep 17 00:00:00 2001 From: Steffen Olszewski Date: Wed, 28 Jul 2021 02:53:39 +0200 Subject: [PATCH 1/2] Fix SVN dirty detection The previous test for the dirty state was flawed and detected externals always as dirty. Use a test for the clean state instead and invert to receive the required value for the filter criteria. --- .../groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy b/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy index a29c244..8fbc190 100644 --- a/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy +++ b/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy @@ -87,7 +87,7 @@ class SVNInfoService implements SCMInfoService { return statuses.findAll { entry -> def path = (entry.file.absolutePath - dir.absolutePath) if (path && !path.startsWith('/userHome')) { - return (entry.nodeStatus != SVNStatusType.UNCHANGED && entry.nodeStatus != SVNStatusType.STATUS_EXTERNAL) || (entry.propertiesStatus != SVNStatusType.UNCHANGED) + return !(entry.nodeStatus == SVNStatusType.UNCHANGED && entry.propertiesStatus == SVNStatusType.UNCHANGED) && entry.nodeStatus != SVNStatusType.STATUS_EXTERNAL } else { return false } From 6fdb696b5adb5a5288a22b4bd2f026a91b168ad3 Mon Sep 17 00:00:00 2001 From: Steffen Olszewski Date: Wed, 28 Jul 2021 02:55:52 +0200 Subject: [PATCH 2/2] Remove relative path calculation and test for /userHome It is unknown why this directory was excluded from the dirty calculation and the check for the empty relative path had the side effect that changes of the project root directory got ignored. --- .../net/nemerosa/versioning/svn/SVNInfoService.groovy | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy b/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy index 8fbc190..fed8c0e 100644 --- a/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy +++ b/src/main/groovy/net/nemerosa/versioning/svn/SVNInfoService.groovy @@ -85,12 +85,7 @@ class SVNInfoService implements SCMInfoService { static List getDirtyStatuses(File dir, SVNClientManager clientManager) { List statuses = getStatus(dir, clientManager) return statuses.findAll { entry -> - def path = (entry.file.absolutePath - dir.absolutePath) - if (path && !path.startsWith('/userHome')) { - return !(entry.nodeStatus == SVNStatusType.UNCHANGED && entry.propertiesStatus == SVNStatusType.UNCHANGED) && entry.nodeStatus != SVNStatusType.STATUS_EXTERNAL - } else { - return false - } + return !(entry.nodeStatus == SVNStatusType.UNCHANGED && entry.propertiesStatus == SVNStatusType.UNCHANGED) && entry.nodeStatus != SVNStatusType.STATUS_EXTERNAL } }