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

RE: Replacing a directory in WC/Repos

From: Jojakim Stahl <joja.lists_at_jojakim.de>
Date: 2006-02-17 13:48:10 CET

> >>> Is there a svn replace or svn copy --replace command available?
> >>> Didn't find something like this yet.
> >>
> >> No. You'll need to first svn rm whatever it is you're wanting to
> >> replace, then svn mv or svn cp in the replacement.
> >
> > Perhaps this should get a line on the wishlist?
> Perhaps. Have you checked the issue tracker to see if it's already
> mentioned?

Didn't find a feature request mentioning "replace" in summary.

> > Because you cannot svn rm and svn cp/mv in one transaction
> > directly in the repository, am I right?
> I don't know. Have you tried?

Don't know how to put two svn invocations into one transaction.

> If you mean with URLs, without a working copy, then you're probably
> right. In a working copy, I thought you could do this.

Try the following lines (they are for windows, but should easily be adapted
to a posix system)

:: remember working root
set testrepo=file:///%CD:\=/%/testrepo

:: create test repository
svnadmin create testrepo

:: create inital structure and import it
md test
md test\prj1
md test\prj2
echo This project will be included by others.>test\prj1\readme.txt
echo This project will be using prj1.>test\prj2\readme.txt
svn import test %testrepo% -m "Initial import"

:: delete imported things
rd /q /s test

:: checkout the two projects
svn co %testrepo%/prj1 prj1
svn co %testrepo%/prj2 prj2

:: include prj1 in prj2 by copy and commit
svn cp prj1 prj2
svn ci prj2 -m "Including prj1"

:: modify file in prj1 and commit
echo A second line.>>prj1\readme.txt
svn ci prj1 -m "Modified prj1"

:: update projects
svn up prj1
svn up prj2

:: try to update prj1 in prj2
:: due to lack of replace command, remove and copy
svn rm prj2\prj1

:: try to copy, but this will fail...
svn cp prj1 prj2

:: OS delete svn rm'ed dir first
rd /q /s prj2\prj1

:: try again to copy
svn cp prj1 prj2

:: try commit, but this will fail...
svn ci prj2 -m "Replaced prj1"

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Feb 17 13:50:58 2006

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.