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

File-based svn:externals

From: <joe.horsnell_at_ubs.com>
Date: 2007-03-12 11:43:17 CET

Hi,

I realise that most of the traffic on the dev mailing list at the moment
is around merge tracking, but hopefully someone can answer a quick
question for me.

Is there a plan to support file-based svn:externals anytime soon? See
attached mail trail for more details, but basically we are in the
process of migrating from ClearCase to Subversion, which on the whole
has been a very pleasant and rewarding experience, but one issue we have
encountered is that ClearCase supports the notion of VOB symbolic links,
which we use quite extensively to 'share' common config across projects.

The following links provide more information on VOB symbolic links:

http://www.agsrhichome.bnl.gov/Controls/doc/ClearCaseEnv/2003.06/ccase/d
oc/all/cc_ref/ct+ln.htm

http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/
com.ibm.rational.clearcase.hlp.doc/cc_main/c_symlinks_ssv.htm

It seems like file-based svn:externals would fit the bill for us.

On the same topic, what about support for relative rather than absolute
URLs for svn:externals? It's a bit clunky having to specify the full
URL, especially when (for us at least) 99.9% of the externals we use are
within our repository. It would be handy to be able to use URL's
relative to your current location (e.g. ../../a-directory) and also
relative to the root of the current repository (e.g.
/common/build/trunk), without having to specify the server.

Thanks,

Joe.

attached mail follows:


Hi Malcolm,

Apologies for the direct mail - I got your email address from a posting
on http://svn.haxx.se that was on a closely related topic to my enquiry.

We are in the process of migrating from ClearCase to Subversion and have
encountered an issue around how symbolic links work in Windows working
copies. As you may know, ClearCase supports so-called VOB symbolic
links, synonymous to symbolic links on a standard Linux file system,
which work on both Windows and Unix platforms by virtue of the fact that
ClearCase has its own virtual file system.

Symbolic links in Subversion work just fine from Linux working copies,
but when Subversion materialises them in a Windows working copy, it
creates a file with the same name as the symlink but containing the text
"link " followed by the path of the link, e.g. "link ../../somefile",
rather than the actual file or directory linked to.

I understand that there would be some considerable problems in trying to
recreate the links in Windows working copies using NTFS junction points
and hard links, but I would still have expected the symlinked files and
directories to be materialised as straight copies of the files or
directories they actually link to.

Is there a way of dictating this behaviour, or is it this way for some
other reason I haven't thought of? I realise of course that
svn:externals let you pull in a directory from another URL, but this
still doesn't cater for individual files. FYI we are using Subversion
1.3.2.

Hopefully you can either answers my questions, or point me in the
direction of someone who can help.

Many thanks in advance,

Joe.

attached mail follows:


Hi Malcolm,

Thanks for your response.

In answer to your questions, firstly regarding how ClearCase VOB
symbolic links work on Windows, basically when you create a snapshot
view (the ClearCase equivalent of a Subversion working copy) any sym
links (to either files or directories) are materialised as normal
files/directories, which are copies of the target of the sym link. There
is nothing special about them, i.e. they're not a short cuts or junction
points or anything magic, they're just normal files and directories.

Whenever you perform an operation on that object, ClearCase knows that
it's actually a sym link and performs the operation on the target in the
VOB. Remember of course ClearCase sym links are 'virtual' (supported
natively in the ClearCase VOB file system) and can only point to other
elements within the VOB.

The main thing we use symbolic links for in ClearCase is sharing of
common files across project, e.g. config. For example, there may be a
config file (such as a Tibco Rendezvous licence file) that is needed in
multiple projects, so we have one 'master' copy in a common directory
that is then sym linked to from all projects that require it.

I realise of course that there are ways around this (e.g. build steps to
copy/deploy shared config) but it is just quite convenient to share
config this way and a number of our builds make use of this approach, so
there is a reasonable amount of effort required to fix our builds and it
would save us quite a bit of time if we could use the same approach on
Subversion. Indeed, we could use the same approach if we only used Linux
working copies, but the Windows builds won't work as the symlinked files
and directories won't contain the correct data.

I'd be interested in your thoughts and comments on this approach in
general, and possible alternatives, plus how/where I should post these
questions to the Subversion developer mailing list.

Thanks and best regards,

Joe.

-----Original Message-----
From: Malcolm Rowe [mailto:malcolm-svn-dev@farside.org.uk]
Sent: 05 March 2007 07:43
To: Horsnell, Joe
Subject: Re: Issue accessing symbolic links in Subversion working copies
on Windows

Hi Joe,

On Fri, Feb 16, 2007 at 01:58:20PM -0000, joe.horsnell@ubs.com wrote:
> Apologies for the direct mail - I got your email address from a
> posting on http://svn.haxx.se that was on a closely related topic to
my enquiry.
>

Sorry it's taken my a while to get back to you - I lost track of your
email.

> We are in the process of migrating from ClearCase to Subversion and
> have encountered an issue around how symbolic links work in Windows
> working copies. As you may know, ClearCase supports so-called VOB
> symbolic links, synonymous to symbolic links on a standard Linux file
> system, which work on both Windows and Unix platforms by virtue of the

> fact that ClearCase has its own virtual file system.
>

Interesting. I knew about ClearCase's vfs, of course, but I didn't know
it could materialise symlinks - what do they look like to Windows users?
How do you manipulate them?

> Symbolic links in Subversion work just fine from Linux working copies,

> but when Subversion materialises them in a Windows working copy, it
> creates a file with the same name as the symlink but containing the
> text "link " followed by the path of the link, e.g. "link
> ../../somefile", rather than the actual file or directory linked to.

Right. Windows filesystems don't support symlinks, so we want to
provide some way for the user to be able to manipulate them, hence the
file's contents.

> I understand that there would be some considerable problems in trying
> to recreate the links in Windows working copies using NTFS junction
> points and hard links, but I would still have expected the symlinked
> files and directories to be materialised as straight copies of the
> files or directories they actually link to.

One problem with using either is that the symlink may not point to
anything that's visible from the client - it's perfectly reasonable to
check out just a directory containing a symlink 'stuff ->
../over_there', edit it to point somewhere else, and commit it, all
without seeing the target for the link.

The other problem, of course, is that it'd be really difficult to create
hard links (for files) or junction points (for directories) in the first
place - and what would you do with them when you'd created them?
(Windows doesn't exactly provide much support for working with either!).

(Actually, Subversion would need support for those things from APR
first, since it uses APR as a portability layer).

So the other option is to dereference the symlink, as you say. But this
is also pretty hard to work with, especially in the directory case.
It may be there's a smart way to do it, but offhand I can't imagine what
would be reasonable if you modified both the source and target of a
pseudo-symlink simultaneously, for example.

> Is there a way of dictating this behaviour, or is it this way for some

> other reason I haven't thought of? I realise of course that
> svn:externals let you pull in a directory from another URL, but this
> still doesn't cater for individual files. FYI we are using Subversion
> 1.3.2.

Well, I've discussed above some of the problems you might encounter if
it worked that way. The fundamental problem is that Windows is pretty
backward in not offering filesystem-level softlinks that applications
can access transparently. (It might be possible for Windows shortcuts
to be treated like 'real' symlinks, for example - Cygwin emulates
symlinks using exactly this method - but unfortunately Windows just
treats them as regular files).

File-specific externals is something we would like to support, but
there's not a lot of impetus behind it at the moment. It might be
worthwhile explaining your requirements in a bit more detail (for
example, what you're using these symlinks for) on the developer mailing
list - it might help us determine if there's something we could do to
help you out.

Regards,
Malcolm

attached mail follows:


Hi Malcolm,

>Interesting. How does one change the organisation of the symlinks
then, if they're just regular files?

Using either the ClearCase command-line tool (the equivalent of svn),
called cleartool, or the GUI. For example, there is an ln command which
cleartool understands that can be used to manipulate ClearCase VOB
symbolic or hard links.

See
http://www.agsrhichome.bnl.gov/Controls/doc/ClearCaseEnv/2003.06/ccase/d
oc/all/cc_ref/ct+ln.htm for more details.

>Okay, so you're really looking to share file data rather than maintain
symlinks per se. So file-based externals would probably solve your use
case.

Yes, I think file-based externals would probably solve our needs, if you
are pretty certain that ClearCase-style VOB symbolic links won't be
developed in Subversion.

On that same topic, do you know if/when relative, rather than absolute,
externals might be developed? It is a bit inconvenient having to specify
the entire URL for each external, especially when 99.9% of the time (for
us at least ;) the externals are to projects within the same (our) repo.

>It would probably be best to follow up on the developer mailing list.

Ok sure, will do.

Thanks again for your help Malcolm. By the way, in case it wasn't clear,
I am a big fan of Subversion and think it's a great product - you guys
have done a fantastic job producing such a performant and scalable
version control system. This is the only real issue I have encountered
during our migration so far (other than most of our builds being
intimately tied to ClearCase, but that's our problem ;) so that's pretty
good!

Although we haven't moved the whole team on to Subversion yet,
anecdotally I can say from my own usage of Subversion (c.f. ClearCase)
the productivity gains are quite impressive. The branching and tagging
performance of Subversion is phenomenal when compared to ClearCase
(10-20mins for an entire VOB label, vs. seconds for a Subversion tag)
and the fact that after checking out a working copy in Subversion you
can just go ahead and edit the files as they're not read-only, unlike
ClearCase where you must explicitly check-out a file (the term checkout
means a different thing in ClearCase - means to tell the server I'd like
to edit this file) which requires network communication and can be, like
most other operations in ClearCase, slooooow.

Subversion does of course encourage a very different development process
than ClearCase, but anything that drives you toward continuous
integration is a good thing too!

Cheers,

Joe.

-----Original Message-----
From: Malcolm Rowe [mailto:malcolm-svn-dev@farside.org.uk]
Sent: 05 March 2007 19:00
To: Horsnell, Joe
Subject: Re: Issue accessing symbolic links in Subversion working copies
on Windows

On Mon, Mar 05, 2007 at 11:51:44AM -0000, joe.horsnell@ubs.com wrote:
> In answer to your questions, firstly regarding how ClearCase VOB
> symbolic links work on Windows, basically when you create a snapshot
> view (the ClearCase equivalent of a Subversion working copy) any sym
> links (to either files or directories) are materialised as normal
> files/directories, which are copies of the target of the sym link.
> There is nothing special about them, i.e. they're not a short cuts or
> junction points or anything magic, they're just normal files and
directories.
>

Interesting. How does one change the organisation of the symlinks then,
if they're just regular files?

> The main thing we use symbolic links for in ClearCase is sharing of
> common files across project, e.g. config. For example, there may be a
> config file (such as a Tibco Rendezvous licence file) that is needed
> in multiple projects, so we have one 'master' copy in a common
> directory that is then sym linked to from all projects that require
it.

Okay, so you're really looking to share file data rather than maintain
symlinks per se. So file-based externals would probably solve your use
case.

> Subversion. Indeed, we could use the same approach if we only used
> Linux working copies, but the Windows builds won't work as the
> symlinked files and directories won't contain the correct data.

You'd also need to make sure you checked out the target of the symlink,
of course.

It would probably be best to follow up on the developer mailing list.
I'm not really familiar with the discussion around file-based externals,
and someone else may have a better idea as to how to achieve your
solution anyway. The mailing list is at dev@subversion.tigris.org, or
see http://subversion.tigris.org/servlets/ProjectMailingListList.

Regards,
Malcolm

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you
should not disseminate, distribute or copy this e-mail. Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses. The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version. This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.

UBS Limited is a company registered in England & Wales under company
number 2035362, whose registered office is at 1 Finsbury Avenue,
London, EC2M 2PP, United Kingdom.

UBS AG (London Branch) is registered as a branch of a foreign company
under number BR004507, whose registered office is at
1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.

UBS Clearing and Execution Services Limited is a company registered
in England & Wales under company number 03123037, whose registered
office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 12 11:43:38 2007

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