跨存储库/项目的颠覆和共享文件? [英] Subversion and shared files across repositories/projects?

查看:42
本文介绍了跨存储库/项目的颠覆和共享文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将客户的 SourceSafe 存储库(3 个项目)迁移到 SVN,其中两个项目共享源文件.(这些项目是单独的产品 - 具有不同的名称和发布版本等)

I am migrating a client's SourceSafe repository (3 projects) to SVN and two of the projects share source files. (These projects are separate products - with different names and release versions, etc)

SVN 是否解决了这个缺点?人们通常如何处理这种情况?

Has SVN resolved this shortcoming? How do people generally handle this scenario?

我知道/能想到的选项

  • 对 SVN 使用 external 或 extern 或其他任何内容.我听说由于各种原因这不是一个好的选择

  • Use the external or extern or whatever for SVN. I hear this is not a good option for various reasons

创建一个包含源的新项目(可能称为共享).问题在于我们仍然必须获取该代码(它不是库)并以某种方式将其导入到项目中.它可以被证明是与上述相同的问题,它引入了额外产品/项目的开销.

Create a new project (maybe called shared) that contains the source. The problem with this is that we still have to get that code (it is not a library) and import it into the project somehow. It can be shown to be the same problem as the one above and it introduces the overhead of an additional product/project.

只需签入两个存储库中的文件并交叉更新它们.这需要开发人员了解共享并记住签入.我想我可以编写一个脚本来检查所有已知的共享文件并在需要时更新它们.

Just check in the files in both repositories and cross-update them. This requires developers to know about the sharing and to remember to check in. I suppose I could write a script that checks all known shared files and updates them when needed.

为共享的两个项目创建一个存储库.这给我留下了必须创建包含两者的顶级项目/存储库的问题,这是标记问题.我真的不想标记顶级伪项目.(标签、主干和分支的东西并不是我想要的.)

Have one repository for the two projects that share. This leaves me with the problem having to create a top level project/repository that contains the two and it is a problem for labeling. I do not really want to label the top pseudo project. (the tags, trunk and branch things are not exactly where I would want them.)

我可能会选择最后一个选项.

I will probably go with the last option.

还有什么意见吗?

推荐答案

我不知道你对 svn:externals 到底听到了什么,但我认为你应该在这里使用它.您甚至可以指定您的 external 指向您共享源的稳定分支或发布标记,或者甚至指向使用它的其他两个项目中的两个不同标记(如果您尽快修复共享代码中的某些错误,您可能需要这个对于项目 A,但您没有足够的时间用项目 B 对其进行全面测试).

I don't know what exactly you heard about svn:externals, but I think that's what you should use here. You can even specify your external to point to a stable branch or release tag of you shared source, or even point to two different tags from the two other projects that use it (you might need this if you fix some bug in the shared code ASAP for project A, but you don't have enough time to test it fully with project B).

您能做的最糟糕的事情是您的选项 3(交叉更新相同文件的两个版本).

The worst thing you could do is your option 3 (cross-updating two versions of the same files).

这篇关于跨存储库/项目的颠覆和共享文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆