How should I setup my Visual Studio projects/solutions in a Mercurial repository?
At my company we have a few different web apps that each share some common libraries. The Visual Studio setup looks like this.
Website 1 Solution Website 1 Shared Library 1 Project Shared Library 2 Project Website 2 Solution Website 2 Shared Library 1 Project Shared Library 2 Project Windows Service Solution Windows Service Project Shared Library 1 Project Shared Library 2 Project Shared Library Solution Shared Library 1 Project Shared Library 2 Project All Projects Solution Website 1 Website 2 Windows Service Project Shared Library 1 Project Shared Library 2 Project
We want to start using Mercurial for source control, but I'm still not sure the best way to do it.
From what I've read you're supposed to use a separate repository for each project. No problem there, but where do the Visual Studio solution files (.sln) go? Should there be a separate repository with just an .sln file?
Ideally the projects that use the shared libraries should all use the same version, and the solution "All Projects Solution" should build without errors, but开发者_开发百科 sometimes we need to branch the shared libraries. What is the best way to do this, and how would the repositories be setup?
How do I get a working copy of a certain branch/tag of the Website 1 solution when every project is in a separate repository. Do I have to pull each one separately, or write a script to do it all at once? Can tortoise hg do that for me?
Any other tips to make this process easier?
Ideally, I'd use mercurial subrepositories to do this. You can then put your "all" solution in the main repositories. The rest of your projects can then be subrepos of that. Mercurial supports subrepositories recursively as well.
Unfortunately TortoiseHg only lists rudimentary support for subrepositories, so you may have to make some choices about how you'd prefer to set things up.
If subrepositores are too much of a burden, you should be fine with putting everything in a single repository. As far as Mercurial is concerned, it doesn't care whether you've split things in repositories or not. The only limit is your situation. If the projects prove to be so large, or commits too frequent that repository management is too much of a pain for example.
Or split everything up into separate repositories and script it. It's entirely up to you.
精彩评论