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

Re: Sharing file inside repository

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2006-12-11 12:03:54 CET

On 12/10/06, Paulo J. Matos <pocm@soton.ac.uk> wrote:
> Hi all,
> I have a repository with 2 projects e.g. Foo and Bar. I would like to
> share a source code file between Foo and Bar which implements a
> module, so that everytime I change it, it affects both projects. I
> could create a common directory and ask Foo and Bar to use code from
> there but given my current code organization, having them in Foo/src
> and Bar/src is easier. Is there a way to share them? I though about
> creating a link. Does svn handle links well?

Yes, but it versions them :-)

What I'd do in your case: Create a separate directory with your module
file in it. Then, create an empty file in each project where you want
that file to be used. After checking out, I'd switch the empty file
with the one you have in your repository (svn switch). When you edit
the switched file, you directly edit the file in your module. When
updating, you always receive the latest changes from other projects'
commits too.

Although, what I'd probably do instead is make the file a separate
project and make 'releases' with a specified API: that guarantees you
won't break one project with the changes you did for another.



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 11 12:04:40 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.