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

Re: Subversion != your filesystem (was mv != (cp && rm))

From: Branko ╚ibej <brane_at_xbc.nu>
Date: 2001-11-28 19:47:18 CET

Florin Iucha wrote:

>On Wed, Nov 28, 2001 at 06:55:24PM +0100, Branko ´┐Żibej wrote:
>>>What will happen if I link A to B and then
>>> 1. cp B C && rm B
>>> 2. mv B C
>>Don't know. :-)
>>The design for "svn ln" is far from complete. It hasn't even been
>>started yet, AFAIK.
>svn ln B A will link A to the "current" B or to the B that was at the
>moment of the link?
Again, I don't know. These are all questions that must be answered in
the "svn ln" spec, but, as there is no such spec at the moment, there
are no answers. Your guess is as good as mine.

(Yes, it would be nice to have link tracking; and, as I said, it can be
done, up to a point. But it's not easy. Personally I'd prefer to keep
things simple: if you change a link's target, but don't change the link,
you get what you asked for.)

>>>You can argue that in both cases A will link to C
>>>but, then what happens
>>> cp B C && change C && cp B D && change D && rm B && commit
>>>where does A point to now?
>>This is not a move. A would be a dangling reference in this case.
>Why would it be a special case when I do only one copy?
Because, by definition, "mv" is an *atomic* "cp & rm". Except that, in
Subversion, we can't guarantee that the cp and rm will happen in the
same commit.

Look: What you're asking is what happens to a symlink when you remove
its target. Obviously, that depends on whether you have some kind of
link tracking or not. If you don't, you get a dangling symlink. If you
do, then it all depends on how you deal with multiple copies.

(There are many ways to do that, but I don't propose go into that now.
Besides being off topic for this list, it would take too long ...)

> And if _single_
>cp followed by rm is special why not call it, let's say "mv", to show
>it's importance ? 8^)
See above. In general, we won't see the cp and rm happening at the same

Brane ´┐Żibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:49 2006

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