Source

openx / build-svn.xml

Full commit
<project name="svn-commands" default="svn-update" basedir=".">
  <property name="svn.path" value="svn"/>
  <condition property="svn.credentials" value="--username ${svn.username} --password ${svn.password}" else="">
    <and>
      <isset property="svn.username"/>
      <isset property="svn.password"/>
    </and>
  </condition>
  <property name="svn.options" value="--non-interactive ${svn.credentials}"/>

  <target name="svn-update">
    <exec dir="${basedir}" executable="${svn.path}" failonerror="true">
      <arg line="update ${svn.options}"/> 
    </exec>
  </target>

 <macrodef name="svn-revert"> 
    <attribute name="file"/> 
    <sequential> 
      <exec dir="${basedir}" executable="${svn.path}" failonerror="true"> 
        <arg line="revert @{file}"/> 
      </exec> 
    </sequential> 
  </macrodef>
</project>