From 2216123c75036a3d5d46b71bf089fccc4eeef232 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Mon, 6 Jan 2014 18:54:50 +0000 Subject: [PATCH] LUCENE-5385: Make precommit work for svn 1.8 or git checkouts git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1555973 13f79535-47bb-0310-9956-ffa450edef68 --- extra-targets.xml | 21 +++++++++++++++++++++ lucene/CHANGES.txt | 5 +++++ lucene/test-framework/build.xml | 3 +-- lucene/tools/build.xml | 2 +- lucene/tools/ivy.xml | 4 ++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/extra-targets.xml b/extra-targets.xml index cdf861df86e..b71b64c84c3 100644 --- a/extra-targets.xml +++ b/extra-targets.xml @@ -105,6 +105,9 @@ '.' + file.getAbsolutePath().substring(baseLen).replace(File.separatorChar, (char)'/'); } + + // do some fake check, to verify if this is valid SVN working copy. If this fails ignore checks but log some useful message. + try { + statusClient.doStatus(basedir, false); + } catch (SVNException ex) { + int code = ex.getErrorMessage().getErrorCode().getCode(); + if (code == SVNErrorCode.WC_UNSUPPORTED_FORMAT.getCode()) { + task.log('WARNING: Unsupported SVN working copy version! Disabling checks...', Project.MSG_WARN); + task.log('If your working copy is on version 1.8 already, please pass -Dsvnkit.version=' + RECOMMENDED_SVNKIT_18 + ' to successfully run checks.', Project.MSG_INFO); + return; + } else if (code == SVNErrorCode.WC_NOT_DIRECTORY.getCode() || code == SVNErrorCode.WC_NOT_FILE.getCode()) { + task.log('WARNING: Development directory is not an SVN checkout! Disabling checks...', Project.MSG_WARN); + return; + } else { + task.log('WARNING: Development directory is not a valid SVN checkout (' + ex.getErrorMessage() + '). Disabling checks...', Project.MSG_WARN); + return; + } + } Set missingProps = new TreeSet(), unversioned = new TreeSet(), changed = new TreeSet(); diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index c56cd31636c..3b6236d08b9 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -109,6 +109,11 @@ Build * SOLR-5590: Upgrade HttpClient/HttpComponents to 4.3.x. (Karl Wright via Shawn Heisey) +* LUCENE-5385: "ant precommit" / "ant check-svn-working-copy" now work + for SVN 1.8 or GIT checkouts. The ANT target prints a warning instead + of failing. It also instructs the user, how to run on SVN 1.8 working + copies. (Robert Muir, Uwe Schindler) + Bug fixes * LUCENE-5285: Improved highlighting of multi-valued fields with diff --git a/lucene/test-framework/build.xml b/lucene/test-framework/build.xml index eaa3d3701d4..a4abbe608b1 100644 --- a/lucene/test-framework/build.xml +++ b/lucene/test-framework/build.xml @@ -27,8 +27,7 @@ - - + diff --git a/lucene/tools/build.xml b/lucene/tools/build.xml index 3a3e3d4071e..4eed862d6a5 100644 --- a/lucene/tools/build.xml +++ b/lucene/tools/build.xml @@ -28,7 +28,7 @@ - + diff --git a/lucene/tools/ivy.xml b/lucene/tools/ivy.xml index 6525f67f041..6b8cafbe059 100644 --- a/lucene/tools/ivy.xml +++ b/lucene/tools/ivy.xml @@ -18,4 +18,8 @@ --> + + + +