SVN-ANT 错误 - “不是工作副本”
我在提交此问题之前阅读了相关问题,但无法找到与我的问题相同的确切问题。
我正在尝试在 Windows 盒子上设置一些自动化。我有 ant 目标进行更新,并且我使用 eclipse 作为我的 java 开发编辑器。 Windows 盒子安装了 svn 客户端 (TortoiseSVN),我使用它从我的存储库中获取新的签出,一旦项目签出,我就执行了 ant 目标。结果如下。
C:\svncheckout\Automation>ant update-svn Buildfile: build.xml update-svn: [svn] started ... [svn] svn: 'C:\svncheckout\Automation' is not a working copy [svn] svn: Cannot read from 'C:\svncheckout\Automation\.svn\format': C:\svncheck out\Automation\.svn\format (The system cannot find the file specified) [svn] svn: 'C:\svncheckout\Automation' is not a working copy [svn] svn: Cannot read from 'C:\svncheckout\Automation\.svn\format': C:\svncheck out\Automation\.svn\format (The system cannot find the file specified) [svn] failed ! BUILD FAILED C:\svncheckout\Automation\build.xml:198: Cannot update dir C:\svncheckout\Automation
这是我的 ant 目标,在阅读了一些论坛后,我发现最好明确告诉目标使用 svnkit 运行,我已经删除了实际的用户名和密码。
<!-- target to update working copy -->
<target name="update-svn">
<svn svnkit="true" javahl="false" username="guest" password="guest">
<update dir= "${checkout}/Automation" revision="HEAD"/>
</svn>
</target>
先感谢您。
I read related question before submitting this question but wasn't able to find the exact question that has the same issue as mine.
I am trying to setup some automation on a windows box. I have ant target to do update and I have used eclipse as my java development editor. Windows box have svn client (TortoiseSVN) installed and I used that to get a fresh checkout from my repository once the project was checked out, I executed the ant target. The result was following.
C:\svncheckout\Automation>ant update-svn Buildfile: build.xml update-svn: [svn] started ... [svn] svn: 'C:\svncheckout\Automation' is not a working copy [svn] svn: Cannot read from 'C:\svncheckout\Automation\.svn\format': C:\svncheck out\Automation\.svn\format (The system cannot find the file specified) [svn] svn: 'C:\svncheckout\Automation' is not a working copy [svn] svn: Cannot read from 'C:\svncheckout\Automation\.svn\format': C:\svncheck out\Automation\.svn\format (The system cannot find the file specified) [svn] failed ! BUILD FAILED C:\svncheckout\Automation\build.xml:198: Cannot update dir C:\svncheckout\Automation
Here is my ant target, and after reading some forums I found out that its better to explicitly tell the target to run with svnkit
I have removed actual username and password.
<!-- target to update working copy -->
<target name="update-svn">
<svn svnkit="true" javahl="false" username="guest" password="guest">
<update dir= "${checkout}/Automation" revision="HEAD"/>
</svn>
</target>
Thank You in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
svn 和 svnant 之间可能存在兼容性问题。
例如
svn --version
svn,版本 1.6.15 (r1038135)
编译于 2010 年 11 月 24 日,15:10:19
TortoiseSVN 1.6.12,内部版本 20536 - 32 位,2010/11/24 20:59:01
颠覆1.6.15,
4月1.3.8
apr-utils 1.3.9
霓虹灯 0.29.5
OpenSSL 0.9.8p 2010 年 11 月 16 日
zlib 1.2.3
阿帕奇蚂蚁
1.7.0\bin\ant -版本
Apache Ant 版本 1.7.0 于 2006 年 12 月 13 日编译
与 svnant-1.2.1.zip 结合,它将生成“工作副本”和缺少 .svn/format 文件的错误
如果 svnant-1.3.1.zip 问题没有问题。
There might be a compatiblity problem between the svn and svnant.
For example
svn --version
svn, version 1.6.15 (r1038135)
compiled Nov 24 2010, 15:10:19
TortoiseSVN 1.6.12, Build 20536 - 32 Bit , 2010/11/24 20:59:01
Subversion 1.6.15,
apr 1.3.8
apr-utils 1.3.9
neon 0.29.5
OpenSSL 0.9.8p 16 Nov 2010
zlib 1.2.3
apache-ant
1.7.0\bin\ant -version
Apache Ant version 1.7.0 compiled on December 13 2006
Combined with svnant-1.2.1.zip it will generate the error with "working copy" and missing .svn/format file
If svnant-1.3.1.zip the issue there's no issue.
错误消息确实说明了一切。您的
C:\svncheckout\Automation
不是工作副本。要验证这一点,您可以检查C:\svncheckout\Automation\.svn\format
是否存在(很可能不存在)。您签出到哪个文件夹?
您是否执行了
导出
操作而不是结账
?或者.svn
文件夹以某种方式被删除了?您是否签出到了不同的文件夹(不是
C:\svncheckout\Automation
)?难道是存储库中不存在
Automation
文件夹吗? (您可以使用 TortoiseSVN 的 Repo 浏览器进行检查。)The error message says it all, really. Your
C:\svncheckout\Automation
is not a working copy. To verify that, you can check whether theC:\svncheckout\Automation\.svn\format
exists (and it probably doesn't.)Which folder did you checkout to?
Could it be that you performed an
export
operation instead ofcheckout
? Or that the.svn
folder got deleted somehow?Could it be that you checked out to a different folder (not
C:\svncheckout\Automation
)?Could it be that the
Automation
folder doesn't exist in the repository? (You can check with TortoiseSVN's Repo-Browser.)我也有同样的问题。就我而言,只需切换到 javahl 即可解决。
编辑:我认为一般问题的根源在于与 ant 中使用的库(在您的情况下为 SVNKit)相比,使用较新版本的 subversion 创建的工作区。我想在我的系统上 javahl 存在于足够新的版本中,而 SVNKit 则没有 - 因此切换到 javahl 解决了我的问题。您也许可以通过更新 ant 脚本使用的 SVNKit 库来解决您的问题。这篇在 tigris 的帖子也指向了这个方向。
I had the same problem. In my case it could be solved by simply switching to javahl.
Edit: I think the general problem is rooted in the workspace being created with a newer version of subversion compared to the library used in ant, in your case SVNKit. I guess that on my system javahl is present in a recent enough version, whereas SVNKit isn't - so that switching to javahl solved my problem. You can probably solve your problem by updating the SVNKit libraries used by your ant skript. This post at tigris also points in that direction.
之前的答案说切换到 javahl,但它造成了很多问题,所以根据我的经验,最好的解决方案是关闭 javahl。
我添加了清理只是 svn cleanup 因为我的 ant 脚本正在运行以照顾 hudson 中的自动化过程。因此,为了避免任何清理过程,我决定添加它。
Previous answer says to switch to javahl but it created be ton of problem so in my experience the best solution is to turn off javahl.
I have added the cleanup just svn cleanup because my ant script is running to take care automation process in hudson. So to avoid any cleanup process I decided to add that.