使用涉及多个项目的解决方案管理 SVN 的最佳实践
在开始之前,以下内容基于通过使用 TortoiseSVN 1.6.x 和 ASP.NET Web 项目(以 Visual Studio 2008 为例)获得的知识。
案例研究
美好的一天场景中,典型的 Subversion 存储库结构可能类似于:
/trunk
/Solution1
/ProjectA
/ProjectB
/ProjectC
/tags
/Solution1
/version_1.0-rc
/version_1.1
/branches
/users
/travis
/Solution1
/john
/Solution1
Solution1
是一个包含 1 到多个 Visual Studio 项目的 Visual Studio 解决方案。- 用户正在开发自己的解决方案分支,偶尔合并回主干。没有人直接在主干上工作。
- 每当有公开发布时,都会从主干创建标签。
然而在现实世界中,项目结构并不那么简单,因为许多 Visual Studio 项目在各种 Visual Studio 解决方案之间共享。存储库看起来更像是:
/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
在示例中,有 2 个产品 Candy
和 Lolly
,共享组件(Visual Studio 项目、DLL)将位于 Fundamental<分别是 /code> 和
Components.ExternalLibraries
文件夹。
假设在主干上工作,为了在 CandyLand
Visual Studio 解决方案上工作,我需要从存储库中签出其文件以及所需的组件,因此解决方案结构可能类似于:
+ CandyLand
+ Candy.Web.Pages
+ Candy.Web.Services
+ Candy.Tests
+ Fundamental.BusinessObjects
+ Fundamental.DataAccess
+ Subsonic-2.2
+ Moq-3.1
移动签出和嵌套文件夹放在一起可能有点烦人,我们使用批处理脚本来为我们做到这一点。
问题
我发现在这种情况下无法进行分支,因为用户分支仅包含分支解决方案中的项目,而不包含共享项目。
与标记相同,我无法创建包含产品解决方案及其共享组件的修订快照的标记。
。
我是不是走错方向了?我是否让这个存储库变得太难管理了?
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 repository 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 svn:externals 包含 Candyland 下的文件夹。
在下面的示例中,
*
标记外部:Use svn:externals to include the folders under Candyland.
In the example below, the
*
marks an external: