Stephane Grenier
Stephane Grenier

Reputation: 15917

How to commit a file in SVN through Ant

Using the SVN task from tigris I can't seem to find a way to just commit one file. Is there any way to do this without first having to checkout the folder in SVN?

Upvotes: 2

Views: 8012

Answers (5)

balmaster
balmaster

Reputation: 173

put subversion/bin into your PATH and write own ant task like

<macrodef name="svn_call">
  <attribute name="src.path" />
  <attribute name="dst.path" />
  <attribute name="command" />
  <sequential>
    <exec failonerror="true" executable="${env.SVN_HOME}/bin/svn" osfamily="windows">
    <arg line="@{command} @{src.path} @{dst.path}" />
    </exec>
    <exec failonerror="true" executable="${env.SVN_HOME}/bin/svn" osfamily="unix">
    <arg line="@{command} @{src.path} @{dst.path}" />
    </exec>
  </sequential>
</macrodef>

Upvotes: -2

Orkan
Orkan

Reputation: 96

In svnant you can commit an unversioned file or tree into the repository with <import/> task

Upvotes: 0

retracile
retracile

Reputation: 12339

If you can also provide WebDAV access to the subversion repository, you could then use curl to upload a single file to the repository without having a working copy. You won't have a useful commit message, etc., so use with caution.

Upvotes: 0

Aaron M
Aaron M

Reputation: 2563

This post has some information about committing a file with checking it out first. http://svn.haxx.se/users/archive-2007-06/0937.shtml

Upvotes: 1

blak3r
blak3r

Reputation: 16516

No. You cannot check in a single file w/o having a working copy which means you will have to checkout at least one directory.

Perhaps I don't fully understand, but you cannot check in a single file with the svn binaries so you certainly can't do it through ant.

Upvotes: 3

Related Questions