svnant update single file with error skipped

80 Views Asked by At

I want to update the content of a file from my local folder to svn, note that the file exists on svn.

first I am checking out with depth empty. then I run update on the script

<svn refid="svn.settings" logFile="${directory}/checkout_log.log">
        <checkout   url="${svn_path}" 
                    destpath="${full_path}"
                    revision="HEAD" depth="empty"
        />
        <update  recurse="false" revision="HEAD" dir="D:\Update\SVNCheckout\T\" file= "test.sql" />

        </svn>

however In the log file its sayes

Skipped 'test.sql'
Summary of conflicts:
  Skipped paths: 1
<Update> finished.

ok I understand there is conflict , however how I can svn resolve the script

1

There are 1 best solutions below

1
On

To avoid conflicts it is better to first check out, then modify the checked out file and then try to check it in. If this fails, then remove all temporary files and try it again.

The overall procedure looks like this (using Ant Contrib as an extension to plain Ant):

<var name="finished" value="false" />
<for list="1,2,3,4,5,5,6,7,8,9,10" param="trynr">
  <sequential>
    <if>
      <equals arg1="${finished}" arg2="false" />
      <then>
        <echo message="#########################################" />
        <echo message="# trynr=@{trynr}" />
        <echo message="#########################################" />
        <trycatch property="errormsg" reference="exceptionObject">
          <try>
            <!-- Delete old checked out files -->
            <delete .../>
            <!-- Check out the file -->

            <!-- Modify the file -->

            <!-- Commit the file -->

            <var name="finished" value="true" />
          </try>
          <catch>
            <echo message="Update failed." />
            <echo message="Error message: ${errormsg}" />
            <if>
              <equals arg1="@{trynr}" arg2="10" />
              <then>
                <echo message="Giving up after @{trynr} attempts." />
                <fail message="Unable to update file. Giving up after @{trynr} attempts." />
              </then>
              <else>
                <echo message="Trying again in 2 seconds ..." />
                <sleep seconds="2"/>
              </else>
            </if>
          </catch>
        </trycatch>
      </then>
      <else />
    </if>
  </sequential>
</for>