Subversion 是否有类似于 VSS 链接的功能?

发布于 2024-08-24 07:18:16 字数 1028 浏览 2 评论 0原文

我正在将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

攒一口袋星星 2024-08-31 07:18:16

我之前研究过使用外部定义,据我所知,它们只能在目录级别使用。

再看看。 Subversion 1.6 支持文件级外部:
http://subversion.apache.org/docs/release-笔记/1.6.html#file-externals

I have looked into using externals definitions before, and from what I can tell they can only be used on the directory level.

Look again. Subversion 1.6 supports file-level externals:
http://subversion.apache.org/docs/release-notes/1.6.html#file-externals

天赋异禀 2024-08-31 07:18:16

您可以将 arch_1 的内容添加为 arch_2 中的 SVN 外部

< strong>更新:

从 SVN 1.6 开始支持文件外部

外部文件

从 Subversion 1.6 开始,您可以添加
您工作的单个文件外部
使用与以下相同的语法进行复制
文件夹。然而,有一些
限制。

外部文件的路径必须
将文件放入现有的
版本化文件夹。一般来说,它使得
直接放置文件最有意义
在有 svn:externals 的文件夹中
设置,但它可以是版本化的
如有必要,子文件夹。相比之下,
目录 externals 会自动
创建任何中间未版本化的
根据需要设置文件夹。

外部文件的 URL 必须位于
与 URL 相同的存储库
将插入外部文件
进入;存储库间文件外部
不支持。

另请参阅: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

External Files

As of Subversion 1.6 you can add
single file externals to your working
copy using the same syntax as for
folders. However, there are some
restrictions.

The path to the file external must
place the file in an existing
versioned folder. In general it makes
most sense to place the file directly
in the folder that has svn:externals
set, but it can be in a versioned
sub-folder if necessary. By contrast,
directory externals will automatically
create any intermediate unversioned
folders as required.

The URL for a file external must be in
the same repository as the URL that
the file external will be inserted
into; inter-repository file externals
are not supported.

See also: SVN 1.6 Release Notes

爱她像谁 2024-08-31 07:18:16

SVN 中与此最接近的方法是使用 Externals

外部定义允许您:

不同的子目录来自存储库中的不同位置,或者可能来自不同的存储库。

The closest thing to this in SVN would be to use Externals.

Externals definitions allow you have:

different subdirectories to come from different locations in a repository, or perhaps from different repositories altogether.

佼人 2024-08-31 07:18:16

是的,至少对于目录有一种方法可以做到这一点。该功能称为外部 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文