tags:

views:

539

answers:

5

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?

+1  A: 

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.

blak3r
+1  A: 

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

Aaron M
A: 

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.

retracile
A: 

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

Orkan
That's importing and not committing. If the file is already in SVN it will fail.
Stephane Grenier
A: 

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>
balmaster
The question is how do you commit a file to SVN "without first having to checkout the folder in SVN?"
Stephane Grenier
sorry, site published first part of my answer only.full answer is:1. declare svn_call task2. for commit one local file into repository use<svn_call command="import" src.path="${yourFileName}" dst.path="${yourRepositoryUrlRoot}/${yourRepositoryPath}/${yourFileName}"/>
balmaster
if you need to update file which already in repositoryyou can use following commands<svn_call command="checkout --depth=empty" src.path="${yourRepositoryUrlRoot}/${yourRepositoryPath}" dst.path="${localTempDir}" /> - this checkout oly folder without any files into localTempDir<svn_call command="update" src.path="${localTempDir}/${yourFileName}" dst.path="" /> - this checkout your file onlyupdate your file any way<svn_call command="commit -m=''" src.path="${localTempDir}/${yourFileName}" dst.path="" /> - this commit your file only<delete dir="${localTempDir}" /> - remove temporary files
balmaster
for update file which already in repository you need chekout dir contain your file :). but you can checkout your file only without other files from repository.
balmaster
also you can first delete your file from repository immediatly(<svn_call command="delete" src.path="${yourRepositoryUrlRoot}/${yourRepositoryPath}/${yourFileName}" dst.path="" />)and import new versionof file again<svn_call command="import" src.path="${yourFileName}" dst.path="${yourRepositoryUrlRoot}/${yourRepositoryPath}/${yourFileName}"/>
balmaster