SVN Ant更新示例 [英] SVN Ant Update example

查看:191
本文介绍了SVN Ant更新示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Ant中很陌生,我想进行SVN更新操作. 我将jar文件添加到ant/lib文件夹中,也将typedef属性添加到我的build.xml文件中.

<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" />

但是现在我需要一些代码示例来从一个文件夹中的存储库进行更新(假设文件夹名称为test) 我查看了互联网,但此svn ant通话提供了一些示例.

我已经尝试过类似的事情

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

解决方案

您拥有typedef权限.

您要执行的操作是更新到SVN未检出的目录.这意味着您的"dir"属性中的目录可能有误.

如果您的"dir"属性指向项目的根目录,则很可能是错误的.您可能已经检出到项目根目录下的"src"文件夹.

在项目的根目录中查找(通常位于工作区根"目录下,该目录与项目同名).查找包含".svn"隐藏目录的所有子目录.奇怪的是,您只从一个存储库中检出,因此,如果是这样,那么您找到的第一个存储库很可能就是您要包含在"dir"指令中的目录.

如果有多个目录可供选择,请在命令行中执行"svn info".对于每个候选目录,您很快就可以将它们整理出来.

I'm quite new in Ant and i want to make an SVN Update operation. I add the jar files into the ant/lib folder, also i add the typedef property in my 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 some code example for making update from repository at one folder (let's say the folder name is test) I look over internet but a few examples are provided with this svn ant call.

I've tried something like this

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

解决方案

You have the typedefs right.

What you are trying to do is update to a directory which wasn't checked out by SVN. This means that your likely have the wrong directory in your "dir" attribute.

If your "dir" attribute points to the project's root directory, odds are it is wrong. You likely checked out to a "src" folder under the project's root directory.

Look in the Project's root directory (typically it is under the Workspace "root" directory, in a directory with the same name as the project). Look for any subdirectories that contain a ".svn" hidden directory. Odds are you only checked out from one repository, so if that's true then the first one you find will likely be the directory you meant to include in the "dir" directive.

If you have multiple directories to select from, at the command line do a "svn info ." for each candidate directory and you will soon be able to sort them out.

这篇关于SVN Ant更新示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆