Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 48272 invoked from network); 25 Apr 2007 08:25:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Apr 2007 08:25:12 -0000 Received: (qmail 31924 invoked by uid 500); 25 Apr 2007 08:25:18 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 31905 invoked by uid 500); 25 Apr 2007 08:25:18 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 31894 invoked by uid 99); 25 Apr 2007 08:25:18 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 01:25:18 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Apr 2007 01:25:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B49451A9838; Wed, 25 Apr 2007 01:24:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r532249 - /geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy Date: Wed, 25 Apr 2007 08:24:50 -0000 To: scm@geronimo.apache.org From: jdillon@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070425082450.B49451A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jdillon Date: Wed Apr 25 01:24:49 2007 New Revision: 532249 URL: http://svn.apache.org/viewvc?view=rev&rev=532249 Log: Use svn export and track the revision to avoid those evil .svn dirs which suck up I/O Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy Modified: geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy URL: http://svn.apache.org/viewvc/geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy?view=diff&rev=532249&r1=532248&r2=532249 ============================================================================== --- geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy (original) +++ geronimo/sandbox/build-support/libraries/system/1/groovy/gbuild/system/library/svn/LibraryImpl.groovy Wed Apr 25 01:24:49 2007 @@ -103,6 +103,25 @@ return value } + private long getSvnRevision(url) { + log.info "Getting SVN revision for URL: $url" + + def xml = svnGet('info', [ '--xml', url ]) + def info = new XmlParser().parseText(xml) + def commit = info.entry[0].commit[0] + + return Long.parseLong(commit.'@revision') + } + + private long getLocalRevision(baseDir) { + def file = new File(baseDir, 'library_revision.txt') + + if (file.exists()) { + return Long.parseLong(file.text) + } + return -1 + } + /** * Check out the library. */ @@ -112,13 +131,29 @@ assert !exists() baseDir.mkdirs() - svn('checkout', [ '--quiet', sourceURL, baseDir ]) + // + // HACK: Export a specific revision so we can avoid those evil .svn + // dirs which really eat up I/O resources for rsync/cp/delete + // + + def rev = getSvnRevision(sourceURL) + + svn('export', [ '--quiet', '--revision', rev, sourceURL, baseDir ]) + + // Make the local revision tracker + def file = new File(baseDir, 'library_revision.txt') + file.delete() + file << rev } /** * Commit changes to the library. */ void commit(String message) { + if (true) { + throw new Exception("This won't work anymore... pending massive update to change how this works") + } + assert message log.info "Commiting changes; message: $message" @@ -136,33 +171,29 @@ assert exists() - def lastCommit = { target -> - def xml = svnGet('info', [ '--xml', target ]) - def info = new XmlParser().parseText(xml) - return info.entry[0].commit[0] - } - - def rcommit = lastCommit(sourceURL) - def lcommit = lastCommit(baseDir) + def rcommit = getSvnRevision(sourceURL) + def lcommit = getLocalRevision(baseDir) // If the checkout was not complete, then the commit details will be missing - if (lcommit == null) { - // - // HACK: Mark as dirty - // + if (lcommit == -1) { + // Mark as dirty dirty = true // So force an update to be made to fully sync the workspace return false } - return rcommit.'@revision' == lcommit.'@revision' + return rcommit == lcommit } /** * Update the library. */ void update() { + if (true) { + throw new Exception("This won't work anymore... pending massive update to change how this works") + } + log.info "Updating library in: $baseDir" assert exists()