tags:

views:

2311

answers:

3

I am in the process of moving from VSS to SVN and I'm not sure how to share files in SVN.

Basically we have the following structure in VSS

$MOSS
  - Components
    - ComponentA
      - bin
    - ComponentB
      - bin
  - GAC Mirror

GAC Mirror holds a shared copy of all the Dlls from the bin folders of the components to allow for easy copying to the GAC.

In VSS all you do is drag the Dll from the bin folder to the GAC Mirror folder and it works it's life out.

How would I do this in SVN?

Thanks in advance.

+1  A: 

We had the same problem. The simple answer is that you can't share files in SVN - in the end we had to restructure our directories and use batch files.

e.g. for source code files that were shared, we moved them to an Include folder, and have all the projects reference that folder.

For binary files that need to be copied to more than one location we store them just once in SVN, and then use batch files to copy them across to the target locations on each developers machine (or also on the build machine).

RickL
I'm in the process of selling the move to SVN and this will not help my cause, sod.
Arry
It was still worthwhile for us to make the change because SVN is faster, more robust, has better support for offsite users. Perhaps you should try and emphasise the other good points. Also the optimistic commit strategy improves productivity (versus the locked file checkin/checkout of VSS).
RickL
Arry, shared files is poor in VSS. The biggest problem is that once you've branched a folder, all shared files in there get branched too so you have to go through deleting them and re-sharing. The 'common' folder is a good alternative.
gbjbaanb
+5  A: 

Is svn:externals what you're after? http://svnbook.red-bean.com/en/1.0/ch07s03.html

tunaranch
Can I link several folders to one doing this?
Arry
It doesn't look like it :( I just tried setting up two different SVN projects as externals in my "main" project's shared folder and only the second external referenced project was copied down.
Sprogz
This should work - you need to have a single `svn:externals` property defined with multiple relative paths that map to absolute repository urls. See the externals section referenced above.
Ken Gentle
I only need it to work in one direction and thus this is perfect for me. I guess I am copying rather than sharing in VSS.
Arry
+2  A: 

I second Rick on this. To me, the whole concept of "sharing" (= having the same file occur in two places at checkouts) is weird.

I guess each versioning system has its own mindset implicitly attached to it. I've tried Perforce and I've stayed with Subversion. Bringing your projects to it without changing the mindset and maybe workflow may be flawed, though.

The Book on svn is a worthy read, to get some of the mindset submerged before doing the plunge. You can select some sections only, you don't have to read all at once.

akauppi
+1 Very true. Shoehorning an existing project layout into any VCS without any changes will often cause you to do things in the wrong way.
JesperE