[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn import of file when file exists in repository

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Wed, 5 Nov 2008 14:31:33 -0600

On Nov 5, 2008, at 05:03, Andy Stocks wrote:

> I have as part of a build process a requirement to check the
> results of a build (jars, wars etc) into a staging repository (i.e.
> not the same repository as the source code) - our deployment tool
> will then pull a particular revision of these files from the
> staging repository to deploy to test and live networks.
> As the result of the build is not under svn control as far as the
> source repository is concerned, I'd ideally like to do an "svn
> import" of the result into a predefined location in the staging
> repository, along with various bits of build related meta-data in
> the comment. This would be performed on a reasonably regular
> basis, when a particular build is deemed suitable for test/release.
> It's not important for the revision number of the staging
> repository to match that of the source repositories.
>
> However, "svn import" baulks if the target file exists in the
> repository being imported to - so this only works the first time.
> I need something that will allow me to "put this arbitrary file at
> this location in the repository, creating a new revision if it
> already exists".
>
> I have seen a couple of posts regarding an extension to "svn
> import" of an "--overwrite" parameter to do precisely this; from
> what I see this hasn't been implemented (e.g. http://svn.haxx.se/
> users/archive-2003-12/0317.shtml ).
>
> The only way I see to do this is have the build system maintain a
> WC of the staging repository, copy the results files to it and
> perform commits - which in this case is a bit messy when it seems a
> single issue of an "svn import" command is 99% there for what I need.
>
> Is the working copy route the only way to go, or have I missed
> something in the docs? Whilst I appreciate it's not a normal way of
> using SVN, I'd appreciate any suggestions.

svnput can do this, for single files:

http://svn.collab.net/repos/svn/trunk/tools/examples/svnput.c

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-05 21:32:01 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.