TFS 2010:如何处理外部“分支”对工作分支的依赖
是否有已建立的“最佳实践”来处理 TFS 工作分支中的外部依赖关系?我的意思是,我们在 TFS 中有一个项目,其中包含常见的第三方库(在本例中我专门处理 log4net),我们根据需要将其分支到其他项目中。现在,我们正在对一个单独的工作分支进行重大更改,这需要更新版本的组件。它看起来基本上是这样的:
$/ThirdParty
/bin
/log4net
$/Product
/Main
/thirdparty
/lognet <-- $/ThirdParty/bin/log4net
/Working1 <-- $/Product/Main
/thirdparty
/log4net <-- $/Product/Main/lognet <-- $/ThirdParty/bin/log4net
部分工作需要根据 .NET 4 客户端配置文件重建 log4net 并引入新版本。通常,当我们升级第三方组件时,它会被签入相应文件夹中的 $/Thirdparty
中,然后各个项目可以自由地合并或不合并最新的二进制文件,只要他们认为合适。
据我所知,为了从 $/ThirdParty/bin/log4net
获取最新的变更集,我需要将其合并到 $/Product/Main
中,< strong>检查是否合并到 TFS,然后将该分支合并到 $/Product/Working1
中。这正是我想要避免的,因为我不想破坏主分支。
所以,我想有两个问题:
有没有办法让这个合并工作而不必将任何内容签入主分支?
是否有更好的总体策略来处理此类依赖关系,同时仍将它们保留在 TFS 中? (我知道 TFS 并不是“意味着”二进制文件,但我们喜欢它,因为我们可以轻松地进行多版本和历史跟踪)。
Is there an established "best practice" for handling external dependencies in TFS working branches? What I mean is, we have a project in TFS that contains common third-party libraries (in this case I'm specifically dealing with log4net), which we branch into our other projects as needed. Now we're making a significant change that I'm doing on a separate working branch, which requires a newer version of the component. It looks basically like this:
$/ThirdParty
/bin
/log4net
$/Product
/Main
/thirdparty
/lognet <-- $/ThirdParty/bin/log4net
/Working1 <-- $/Product/Main
/thirdparty
/log4net <-- $/Product/Main/lognet <-- $/ThirdParty/bin/log4net
Part of the work requires rebuilding log4net against the .NET 4 client profile and bringing in the new version. Normally, when we upgrade a third party component, it's checked into $/Thirdparty
in the appropriate folder, then the individual projects are free to merge the latest binary, or not, as they see fit.
As far as I have can determine, in order to get the latest changeset from $/ThirdParty/bin/log4net
I need to merge that into $/Product/Main
, check the merge into TFS, then merge that branch into $/Product/Working1
. That's exactly what I want to avoid, because I don't want to disrupt the main branch.
So, I guess two questions:
Is there a way to get this merge to work without having to check anything into the main branch?
Is there a better overall strategy for handling these kind of dependencies while still keeping them in TFS? (I know TFS isn't "meant" for binaries, but we like it because of the easy multiple-version and history tracking we get out of it).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
回答1:
是的。您可以从 ThirdParty 到working1 进行无基础的合并。这是 MSDN 页面:
http://msdn.microsoft.com/en-us/library/bb668976.aspx
至于2:
如果您的主项目可以使用 2 个以上不同版本的 3rd 方二进制文件,那么我建议将 3rd 方二进制文件的单独版本存储在 $/ThirdParty 区域中,并且在 3rd 方区域和 Main 区域中的文件之间不要有直接链接区域。
Answer to 1:
Yes. You can do a baseless merge from ThirdParty to Working1. Here's the MSDN page:
http://msdn.microsoft.com/en-us/library/bb668976.aspx
As for 2:
If your Main project can use 2+ different versions of your 3rd party binary, then I recommend storing the separate versions of the 3rd party binary in the $/ThirdParty area and not having a direct link between files in the 3rd party area and the Main area.
为什么不完全消除第三方项目呢?只需将所有版本的第 3 方库保留在文件共享上,并根据需要将相应的版本签入每个项目的树中即可。
Why not eliminate the ThirdParty project altogether? Just keep all versions of the 3rd party libs on a file share and check the appropriate one into each project's tree as appropriate.