views:

58

answers:

4

So we're gradually moving all our projects across into SVN, from CVS.

One project in particular has two parallel development streams that share a lot of code, and they accomplish this with a neat trick on branch tags.

Some files are branched normally as they diverge on the different streams:

foo.c

  • 1.18         --- HEAD, VERSION-1-BRANCH
  • 1.15.2.10 --- VERSION-2-BRANCH

Others don't differ between the branches, and are 'shared' between the branches. Any updates automatically get included in both branches:

bar.c

  • 1.25 --- HEAD, VERSION-1-BRANCH, VERSION-2-BRANCH

As far as I can see, there's no way to accomplish this same 'linking' of branches in subversion, on a file-by-file basis. Someone please tell me it isn't so?

+2  A: 

For sharing code between projects, SVN has externals.

sbi
+1  A: 

You are correct in that there is no way to do file sharing in this sense. You might want to look into using svn:externals though. This would require that you split the source into separate directories though...

D.Shawley
+2  A: 

Since Subversion 1.6 there has been support for the svn:externals property at a file level. In previous versions it only worked on a directory basis

Ryu
Thanks - also thanks to everyone who suggested externals. This seems to be the Right Thing, although it's not really usable in our precise situation. I don't have enough rep to + everyone, but thanks! :)
paulw1128
+1  A: 

Alternatively, you could consider using svn:externals.

Sorry, I'm not sure if the previous three posters all hit the enter key at the same time or if there's a serious echo in the room. :-)

Jay