You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by cr...@apache.org on 2010/06/06 06:59:56 UTC

svn commit: r951817 - in /forrest/trunk/tools/forrestbot/core: deploy.xml getsrc.xml

Author: crossley
Date: Sun Jun  6 04:59:56 2010
New Revision: 951817

URL: http://svn.apache.org/viewvc?rev=951817&view=rev
Log:
Use plain svn commands rather than Jsvn.
Contributed by: Tim Williams
Issue: FOR-1198

Modified:
    forrest/trunk/tools/forrestbot/core/deploy.xml
    forrest/trunk/tools/forrestbot/core/getsrc.xml

Modified: forrest/trunk/tools/forrestbot/core/deploy.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/tools/forrestbot/core/deploy.xml?rev=951817&r1=951816&r2=951817&view=diff
==============================================================================
--- forrest/trunk/tools/forrestbot/core/deploy.xml (original)
+++ forrest/trunk/tools/forrestbot/core/deploy.xml Sun Jun  6 04:59:56 2010
@@ -147,13 +147,12 @@
   <property name="deploy.svn.svn-filestoadd" location="work/svn-deploy/${ant.project.name}.toadd"/>
   <target name="deploy.svn" unless="build.failed" description="FB: Deploy by committing to an SVN repository">
 <!-- get current SVN source -->
-    <svncheckout
-        repositoryurl="${deploy.svn.url}"
-        username="${deploy.svn.user}"
-        password="${deploy.svn.password}"
-        destination="${deploy.svn.svn-dir}"
-        failonerror="true"
-    />
+    <exec executable="svn" dir="." failonerror="true">
+      <arg value="co"/>
+      <arg value="${deploy.svn.url}"/>
+      <arg value="${deploy.svn.svn-dir}"/>
+    </exec>
+
 <!-- copy new files into sandbox -->
     <copy todir="${deploy.svn.svn-dir}">
       <fileset dir="${build.site-dir}"/>
@@ -168,21 +167,39 @@
       filenames in the list are new files
     -->
     <replace file="${deploy.svn.svn-filestoadd}" token="?      " value=""/>
-    <replace file="${deploy.svn.svn-filestoadd}" token="M      " value=""/>
+    <replaceregexp file="${deploy.svn.svn-filestoadd}"
+                             match="M       .*\n"
+                             replace=""
+                             byline="false" flags="s"/>
 <!-- don't fail on error here because
       1) the targets file might have 'bad' filenames but we should continue
       2) we would've already failed if the svn executable wasn't found
     -->
-    <exec executable="svn" dir="${deploy.svn.svn-dir}">
-      <arg value="add"/>
-      <arg value="--targets"/>
-      <arg value="${deploy.svn.svn-filestoadd}"/>
-    </exec>
+    
+    <condition property="addedFiles">
+     <length file="${deploy.svn.svn-filestoadd}" when="greater" length="0" />
+    </condition>
+    
+    <if>
+      <equals arg1="${addedFiles}" arg2="true" />
+      <then>
+       <echo message="New documents were added." />
+       <exec executable="svn" dir="${deploy.svn.svn-dir}">
+        <arg value="add"/>
+        <arg value="--targets"/>
+        <arg value="${deploy.svn.svn-filestoadd}"/>
+       </exec>
+      </then>
+      <else>
+       <echo message="No new documents have been added." />
+      </else>
+    </if>
 <!-- check in to SVN -->
-    <svncommit
-        target="${deploy.svn.svn-dir}"
-        repositoryurl="${deploy.svn.url}"
-        commitmessage="${deploy.svn.commit-message}"
-    />
+    <exec executable="svn" dir="." failonerror="true">
+      <arg value="commit"/>
+      <arg value="${deploy.svn.svn-dir}"/>
+      <arg value="-m ${deploy.svn.commit-message}"/>
+     </exec>
+
   </target>
 </project>

Modified: forrest/trunk/tools/forrestbot/core/getsrc.xml
URL: http://svn.apache.org/viewvc/forrest/trunk/tools/forrestbot/core/getsrc.xml?rev=951817&r1=951816&r2=951817&view=diff
==============================================================================
--- forrest/trunk/tools/forrestbot/core/getsrc.xml (original)
+++ forrest/trunk/tools/forrestbot/core/getsrc.xml Sun Jun  6 04:59:56 2010
@@ -89,11 +89,14 @@
   <property name="build.svn-dir"    location="work/svn"/>
   <target name="getsrc.svn" description="FB: Get source from an SVN repository">
     <echo level="info">svn: ${getsrc.svn.url} -> ${build.svn-dir}/${ant.project.name}</echo>
-    <svncheckout repositoryUrl="${getsrc.svn.url}"
-      destination="${build.svn-dir}/${ant.project.name}"
-      revision="${getsrc.svn.revision}"
-      failonerror="true"
-      recursive="true"/>
+    
+    <exec executable="svn" dir="." failonerror="true">
+      <arg value="co"/>
+      <arg value="${getsrc.svn.url}"/>
+      <arg value="${build.svn-dir}/${ant.project.name}"/>
+      
+    </exec>
+    
     <echo level="info">Loading ${build.svn-dir}/${ant.project.name}/forrest.properties..</echo>
     <loadproperties srcFile="${build.svn-dir}/${ant.project.name}/forrest.properties"/>
     <loadproperties srcFile="${forrest.home}/main/webapp/default-forrest.properties"/>