1

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.

Andreas Bonini
  • 44,018
  • 30
  • 122
  • 156
add-semi-colons
  • 18,094
  • 55
  • 145
  • 232

4 Answers4

2

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.

Alin
  • 61
  • 4
  • upvote. I strongly suspect this is the (my) problem. SVN 1.7 went from a `.svn` folder at each sub-folder to a single `.svn` at the checkout root. My NAnt script runs fine on our (Jenkins) build server where "sub root folders" are separate checkouts. On my local machine I have a single checkout at our "root" and the script fails. – radarbob Mar 30 '16 at 19:14
1

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.)

Eli Acherkan
  • 6,401
  • 2
  • 27
  • 34
1

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.

zb.
  • 456
  • 4
  • 3
0

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.

add-semi-colons
  • 18,094
  • 55
  • 145
  • 232