Subversion 是否有类似于 VSS 链接的功能?
我正在将 Visual SourceSafe 代码存储库迁移到 Subversion,但遇到了问题。
以下是我们当前源代码树(在 VSS 中)的简化布局:
project_root\
|-libs\
|-tools\
|-arch_1\
| |-include
| |-source
|-arch_2\
|-include
|-source
我的问题出在我们的两个 arch_
文件夹中。每个 arch_
文件夹将针对不同的硬件架构而构建,但两个文件夹的内容实际上是相同的。 arch_2
中的文件仅仅是指向 arch_1
中文件的 VSS 链接,只有少数例外。工作通常签入和签出 arch_1
文件夹,VSS 链接确保此处签入的任何代码也会在 arch_2
文件夹中更新。
转向 Subversion,是否有任何行为类似于 VSS 的链接?也就是说,有没有一种方法可以使不同文件夹中的两个文件神奇地相互关联,以便它们始终彼此同步(对一个文件的更改也会影响另一个文件)?
注意:我知道这里的正确答案是修复构建系统。该项目的构建系统大约在十年前拼凑在一起,当时我们的编译器/构建系统还不够智能,无法为两种不同的体系结构编译充满源代码的同一文件夹。感谢 make
和更新的编译器,我们可以重写构建系统以消除对两个并行源文件夹的依赖。然而,这需要我们目前没有的时间(我们正在失去 VSS 服务器的许可证,并且被迫在相当短的时间内进行迁移)。我希望找到一个 Subversion 解决方案来解决这个问题,因为目前,我们的时间最好花在让迁移顺利进行上,而不是重写构建系统(这是我的待办事项列表中的下一个!)。
感谢您的帮助!
澄清:我之前研究过使用外部定义,据我所知,它们只能在目录级别使用。我正在寻找在文件级别运行的东西,因为我们的一些目录混合了共享/链接文件和非链接、特定于体系结构的文件。
I am migrating a Visual SourceSafe code repository to Subversion and I am running into a problem.
Here is a simplified layout of our current source code tree (in VSS):
project_root\
|-libs\
|-tools\
|-arch_1\
| |-include
| |-source
|-arch_2\
|-include
|-source
My problem is in our two arch_
folders. Each arch_
folder will be built for a different hardware architecture, but the contents of the two folders are practically identical. The files in arch_2
are merely VSS links to the files in arch_1
, with only a small handful of exceptions. Work is generally checked into and out of the arch_1
folder, and the VSS links make sure that any code checked in here is updated in the arch_2
folder as well.
Moving to Subversion, is there anything that will behave like VSS's links? That is, is there a way to have two files in separate folders magically associated with one another such that they will always be in sync with each other (changes to one will affect the other as well)?
Note: I know the correct answer here is to fix the build system. The build system on this project was pieced together roughly a decade ago, back when our compiler/build system wasn't intelligent enough to compile the same folder full of source code for two different architectures. Thanks to make
and updated compilers, we can re-write the build system to eliminate this dependency on two parallel source folders. However, this will take time that we don't have at the moment (we are losing our license to our VSS server and are being forced to migrate on rather short notice). I am hoping to find a Subversion solution to this problem because at the moment, our time would be much better spent making the migration run smoothly than re-writing the build system (which is next on my to-do list!).
Thank you for your help!
Clarification: I have looked into using externals definitions before, and from what I can tell they can only be used on the directory level. I am looking for something that operates on the file level, as some of our directories have a mix of shared/linked files and non-linked, architecture-specific files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
再看看。 Subversion 1.6 支持文件级外部:
http://subversion.apache.org/docs/release-笔记/1.6.html#file-externals
Look again. Subversion 1.6 supports file-level externals:
http://subversion.apache.org/docs/release-notes/1.6.html#file-externals
您可以将 arch_1 的内容添加为 arch_2 中的 SVN 外部
< strong>更新:
从 SVN 1.6 开始支持文件外部
另请参阅:SVN 1.6 发行说明
You can add the content of arch_1 as an SVN External in arch_2
Update:
File externals are support as of SVN 1.6
See also: SVN 1.6 Release Notes
SVN 中与此最接近的方法是使用 Externals。
外部定义允许您:
The closest thing to this in SVN would be to use Externals.
Externals definitions allow you have:
是的,至少对于目录有一种方法可以做到这一点。该功能称为外部 http://svnbook.red-bean.com/en /1.0/ch07s03.html 自从我使用 Visual Studio 以来已经有一段时间了,但即使是 10 年前,VSS 链接仍然比 SVN 外部链接工作得更好。然而 SVN 外部功能是可用的。通常最好将项目组织到库中(基本目录中的公共代码),然后您可以让项目使用库的外部内容,而不是将一个项目放在另一个项目子目录的外部。最终 SVN 将拥有文件和目录的外部 http://subversion.tigris .org/issues/show_bug.cgi?id=937
Yes there is a way to do this at least for directories. The feature is called externals http://svnbook.red-bean.com/en/1.0/ch07s03.html its been a while since i've used visual studio but even way back 10 years ago VSS links still work better than SVN externals. However the SVN externals are functional. Your usually best to organize your project into libraries(common code in a base directory) and then you can have the project use externals to the libraries, vs having one project external to another projects subdirectory. Eventually SVN will have externals for files as well as directories http://subversion.tigris.org/issues/show_bug.cgi?id=937