SVN-ANT 错误 - “不是工作副本”

发布于 2024-08-15 09:26:17 字数 1348 浏览 7 评论 0原文

我在提交此问题之前阅读了相关问题,但无法找到与我的问题相同的确切问题。

我正在尝试在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

守不住的情 2024-08-22 09:26:17

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.

风筝有风,海豚有海 2024-08-22 09:26:17

错误消息确实说明了一切。您的 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 the C:\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 of checkout? 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.)

山人契 2024-08-22 09:26:17

我也有同样的问题。就我而言,只需切换到 javahl 即可解决。

<svn svnkit="false" javahl="true">
    <update dir="${source.dir}" revision="HEAD" />
</svn>        

编辑:我认为一般问题的根源在于与 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.

<svn svnkit="false" javahl="true">
    <update dir="${source.dir}" revision="HEAD" />
</svn>        

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.

星星的轨迹 2024-08-22 09:26:17

之前的答案说切换到 javahl,但它造成了很多问题,所以根据我的经验,最好的解决方案是关闭 javahl。

enter code here

<!-- target to update working copy -->
<target name="update-svn">
     <svn svnkit="true" javahl="false" username="username" password="password">
        <cleanup dir="${checkout}/myframework"/>
        <update dir= "${checkout}/myframework" revision="HEAD"/>
     </svn>
</target>

我添加了清理只是 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.

enter code here

<!-- target to update working copy -->
<target name="update-svn">
     <svn svnkit="true" javahl="false" username="username" password="password">
        <cleanup dir="${checkout}/myframework"/>
        <update dir= "${checkout}/myframework" revision="HEAD"/>
     </svn>
</target>

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文