geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
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 GMT
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()



Mime
View raw message