SVN Ant Update Example

I am new to Ant and I want to do an SVN update operation. I add jar files to the ant / lib folder, also add the typedef property in the build.xml file.

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpath="ant/lib/svnant.jar;ant/lib/svnClientAdapter.jar;ant/lib/svnkit.jar;ant/lib/svnjavahl.jar" />

But now I need an example code to create an update from the repository in one folder (let's say the folder name is a test) I am browsing the Internet, but several examples are accompanied by this svn Ant call.

I tried something like this

<target name="svn-update">
    <svn username="test" password="*****">
        <update revision="HEAD" dir="com.project.blackbox.eclipse" />
    </svn>
</target>
+3
source share
3 answers

You have typedefs right.

What you are trying to do is update to a directory that SVN has not verified. This means that you probably have the wrong directory in your "dir" attribute.

"dir" , , . , "src" .

Project ( Workspace , ). , ".svn". , , , , , , "dir" .

, "svn info". -, .

+1

:

:

tortisesvn version - 1.7
subversuin version - 1.7
Ant version - 1.8 

Make sure you checkout with with new version of tortisesvn client. 

<!-- Execute svn update command -->
<target name="fetch-update-code" description="Fetches update code from base/current working repository" >
    <exec executable="svn" dir="D:/opt/trunk" spawn="false">
        <arg value="update" />
        <arg value="--username=${svn.username}" />
        <arg value="--password=${svn.password}" />
    </exec>
</target>


 Hope this helps: 
+1

, , dir:

<svn username="test" password="*****">
    <update revision="HEAD" dir="${basedir}/com.project.blackbox.eclipse" />
</svn>

The update command should not be anything special. You just need to make sure that you are using the correct directory, and this must be a working version of svn.

0
source

All Articles