views:

55

answers:

2

I've begun setting up SVN repositories to store my code, and am wondering if a single Visual Studio solution can have projects from multiple repositories. I have a shared library with different helper functions, generic custom controls, etc, that are used by multiple projects, and hosted in its own repository. Then I have my project repository, which contains all of the program-specific code such as forms, etc. I know I could copy the shared library into the program's repository, then copy them back when I make changes, but I'd much rather keep them in different repositories so I can hit "Commit" and the general library commits to it's repository, and the program code commits to it. I'm currently using AnkhSVN, but if it's possible with other tools, I'll look into it.


Preemptive clarification for all the "just use one repository" answers: The shared library is hosted in an online repository, viewable by anyone, but the program code is proprietary and resides on our office servers, so they need different repositories.

+2  A: 

Yes it can, though you'll only be able to commit to projects from one repository at a time. One way of achieving this and making it reproducible by any developer who checks out your project is to use the svn:externals property on your solution's root folder to pull in projects from other repositories.

To edit or add this property, you can either use the svn command line, or TortoiseSVN. You'll find more details on the svn:externals property itself in the Subversion red book.

David M
I'm quite new to SVN - could you give me a little more instruction? Do I add `svn:externals` through VS to the .sln, or through some other tool? Then how do I pull in other projects? The only options I see open up other projects in new solutions.
Daniel Rasmussen
Answer edited to include some details.
David M
I'm still having problems adding projects to Visual Studio through AnkhSVN.
Daniel Rasmussen
A: 

Like David says this is possible.

I would like to add to this that having multiple repositories not only takes away the ability to atomically commit, but also you won't be able to branch/tag the project and its dependencies into a single tag or branch. I wouldn't recommend using multiple repositories for these reasons.

Sander Rijken