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

Re: svn cp question

From: <cmpilato_at_collab.net>
Date: 2002-11-21 16:57:18 CET

andreas.koenig@anima.de (Andreas J. Koenig) writes:

> When I read the help text for copy:
>
> % svn help cp
> copy (cp): Duplicate something in working copy or repos, remembering history.
> usage: svn copy SRC DST.
>
> SRC and DST can each be either a working copy (WC) path or URL:
> WC -> WC: copy and schedule for addition (with history)
> WC -> URL: immediately commit a copy of WC to URL
> URL -> WC: check out URL into WC, schedule for addition
> URL -> URL: complete server-side copy; used to branch & tag
>
> I would believe that
>
> svn copy trunk tags/FOO
> svn -m '' commit
> rm -rf tags/FOO
>
> is equivalent to
>
> svn copy http://.../trunk http://.../tags/FOO
>
> but I'm not sure about this and find no answer in manpage or book.
>
> Are they equivalent?

Not exactly.

The biggest difference between the two is that the URL->URL version is
guaranteed to make a copy of .../trunk at the HEAD revision to
.../tags/FOO. If, however, you do this operation WC->WC, you add a
LOT of complexity. Namely, if you .../trunk is not up-to-date, or
otherwise contains mixed revisions (as in, /trunk is at revision 2,
/trunk/A is at at revision 4, /trunk/B is at revision 5, etc...) then
you are actually copying those individual revisions of everything to
the new location.

Secondly (and this is minor), doing the WC->WC copy + a commit will
actually add an entry for FOO in your .../tags/.svn/entries. Of
course, you rm'd the FOO directory, so status should show it as
versioned but missing from disk. URL->URL copy will not make any
changes to your working copy.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 21 16:59:52 2002

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

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