开发者

Best practice to manage SVN with a solution with multiple projects involved

Before I start, the following is based on knowledge gained through usage of TortoiseSVN 1.6.x and ASP.NET web projects with Visual Studio 2008 as example.

Case Study

Say, in a happy day scenario, a typical subversion repo开发者_JAVA技巧sitory structure can be somewhere similar to:

/trunk
    /Solution1
        /ProjectA
        /ProjectB
        /ProjectC
/tags
    /Solution1
        /version_1.0-rc
        /version_1.1
/branches
    /users
        /travis
            /Solution1
        /john
            /Solution1
  • Solution1 is a Visual Studio Solution containing 1 to many Visual Studio Projects.
  • Users are working on their own solution branch, merging back to the trunk once in a while. No one is working directly on the trunk.
  • Tags are created from trunk whenever there's a public release.

However in the real world, the project structure isn't that simple as many Visual Studio projects are shared between various of the Visual Studio solutions. The repository looks more like:

/trunk
    /CandyLand
        /Candy.Web.Pages
        /Candy.Web.Services
        /Candy.Tests
    /LollyApp
        /Lolly.App.WinForm
        /Lolly.App.Services
        /Lolly.Tests
    /Fundamental
        /Fundamental.BusinessObjects
        /Fundamental.DataAccess
    /Components.ExternalLibraries
        /Subsonic-2.2
        /Moq-3.1
        /Lucene.NET-2.0

Where in the example there are 2 products Candy and Lolly, and shared components (Visual Studio projects, DLLs) will be in Fundamental and Components.ExternalLibraries folders respectively.

Assume working off trunk, in order to work on CandyLand Visual Studio Solution, I need to checkout its files from repository as well as required components, so the solution structure may look something like:

+ CandyLand
    + Candy.Web.Pages
    + Candy.Web.Services
    + Candy.Tests
    + Fundamental.BusinessObjects
    + Fundamental.DataAccess
    + Subsonic-2.2
    + Moq-3.1

Moving the checkouts and nest folders together can be a bit annoying, we use batch scripts to do this for us.

Problem

I found it impossible to branch under this circumstance where user branches will only contain projects in branched solutions and not the shared projects.

Same with tagging, I cannot create a tag that contains both revision snapshot of product solution and its shared components.

.

Am I going in the wrong direction? Have I made this repository too difficult to manage?


Use svn:externals to include the folders under Candyland.

In the example below, the * marks an external:

+ CandyLand
    + Candy.Web.Pages
    + Candy.Web.Services
    + Candy.Tests
    * Fundamental.BusinessObjects
    * Fundamental.DataAccess
    * Subsonic-2.2
    * Moq-3.1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜