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

Re: how to make svn _follow_ symbolic links?

From: Les Mikesell <lesmikesell_at_gmail.com>
Date: Tue, 21 Jul 2009 18:48:41 -0500

Misha Aizatulin wrote:
> Blair Zajac wrote:
>
>
>> It doesn't choke. It was deliberately designed to handle symbolic
>> links. If you re-symlink a symlink, then Subversion will see the change
>> and allow you to version path the symlink points to just as Subversion
>> version's file content changes.
>>
>
> It is a nice feature, but it doesn't work, if the symlink points to a
> file outside of the repository. And this has to be the case, if I want
> to add the same file to two repositories.
>
Sure it works - you commit a symlink, you get back the same symlink in a
checkout. If you are using symlinks, the contents of the target aren't
your responsibility - the name is re-evaluated during the open() and
presumably you had some reason to want that to happen or you wouldn't
have used a symlink. But subversion just gives you back what you
committed. As a feature request perhaps it would make sense as a
property, but there would be some odd implementation details as to what
to do with the pristine copy and what you'd like to have happen when
your working copy containing the symlink is updated. Would you want an
update to follow the symlink and produce a surprising change in the
other working copies that have no other relationship? And when you
commit that other working copy, how is subversion supposed to check that
the target of the symlink changed?

> Well, what happens, if I try to manually change a regular file during
> an svn update? If the answer is "a mess", then there is no bigger mess
> with symlinks. If the answer is "svn uses locking / checksum
> verification / whatever", then why not apply these mechanisms to the
> target of the link?
> With one word, svn should treat the link target exactly as if it were
> a regular file.
>
>
Remember, subversion expects other people to be committing changes and
it expects you to be updating your working copies. Are you sure you
want the symlink targets to update?

>> BTW, it takes more work in the code to follow them then not too, because
>> you have to check if it's a symlink or not and then use readlink() to
>> get what the symlink points to.
>>
>
> Oh, ok. I always thought that doing a regular open() would follow the
> links, so that if the programmer does nothing, the links are treated
> transparently. I never checked myself though.
>

You can get the behavior you want with hard links but I don't know what
happens during an update (whether the existing link is deleted and
recreated or if the changes are written to the existing link and thus
affect all other links).

-- 
   Les Mikesell
     lesmikesell_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2373853
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-07-22 01:50:00 CEST

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.