You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2011/01/30 15:14:26 UTC

svn commit: r1065283 - /incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala

Author: reto
Date: Sun Jan 30 14:14:26 2011
New Revision: 1065283

URL: http://svn.apache.org/viewvc?rev=1065283&view=rev
Log:
CLEREZZA-412: no longer mutating strings

Modified:
    incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala

Modified: incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala
URL: http://svn.apache.org/viewvc/incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala?rev=1065283&r1=1065282&r2=1065283&view=diff
==============================================================================
--- incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala (original)
+++ incubator/clerezza/issues/CLEREZZA-412/renamer/src/main/scala/org/apache/clerezza/renamer/App.scala Sun Jan 30 14:14:26 2011
@@ -26,9 +26,9 @@ object App extends Application {
 	}
 
 	def processPom(file: File) {
-		val stringContent = Source.fromFile(file).mkString
-		stringContent.replace("<artifactId>"+prefix,"<artifactId>")
-		stringContent.replace("<module>"+prefix,"<module>")
+		var stringContent = Source.fromFile(file).mkString
+		stringContent = stringContent.replace("<artifactId>"+prefix,"<artifactId>")
+		stringContent = stringContent.replace("<module>"+prefix,"<module>")
 		val fw = new FileWriter(file)
 		fw.write(stringContent)
 		fw.close()
@@ -74,8 +74,19 @@ object App extends Application {
 		processPom(p)
 	}
 
-	for (d <- getAllDirs(root);
-			if (d.getName.startsWith(prefix))) {
-		processDirectory(d)
+	def matchingDirs = for (d <- getAllDirs(root);
+			if (d.getName.startsWith(prefix))) yield d
+	while(matchingDirs.size > 0) {
+		try {
+			for (d <- matchingDirs) {
+				exec("svn", "up", root.getAbsolutePath)
+				Thread.sleep(1000)
+				processDirectory(d)
+				exec("svn", "cleanup", root.getAbsolutePath)
+				Thread.sleep(1000)
+			}
+		} catch {
+			case e: RuntimeException => println("once again a runtime exception, probably svn unable to read chunk size")
+		}
 	}
 }