0

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

Moudiz
  • 7,211
  • 22
  • 78
  • 156

1 Answers1

0

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>
vanje
  • 10,180
  • 2
  • 31
  • 47
  • you mean check out all the files ? svn checkout with `depth="files` ? what i am doing is creating an empty folder, checking out with depth empty then i am trying to update the file that exists on svn. but i am not able to update the file that on svn because its different version. is there way where i can update the file ? because as i understand from your answer is to checkout all the files however i dont want that size because the size is 100gb – Moudiz Jun 05 '18 at 13:52