在SVN中创建链接文件

发布于 2024-12-05 19:24:59 字数 583 浏览 0 评论 0原文

我在 Windows XP 上使用 SVN。

情况:SVN 作为文档存档。我有一些文件需要组织到不同的文件夹中,但仍保留原始文件结构。

Example: In a folder called "Templates"

File1.doc
File2.doc
File3.xls
File4.xls

现在,我希望将它们组织在不同的文件夹中:

Templates\Type1
      File1.doc -> ..\File1.doc
      File2.doc -> ..\File2.doc
      File3.xls -> ..\File3.xls

Templates\Type2
      File1.doc -> ..\File2.doc
      File2.doc -> ..\File1.doc
      File3.xls -> ..\File4.xls

当修改 Templates 文件夹中的文件时,Type* 文件夹中的文件指向正确的文件。

我如何在 SVN 中实现这一目标?还有其他替代方法可以做到这一点吗?

I use SVN on Windows XP.

Situation: SVN as document archive. I have a few files that need to be organized into various folders and yet retain the orginal file structure.

Example: In a folder called "Templates"

File1.doc
File2.doc
File3.xls
File4.xls

Now, I want these to be organized in different folders:

Templates\Type1
      File1.doc -> ..\File1.doc
      File2.doc -> ..\File2.doc
      File3.xls -> ..\File3.xls

Templates\Type2
      File1.doc -> ..\File2.doc
      File2.doc -> ..\File1.doc
      File3.xls -> ..\File4.xls

When the files in the Templates folder are modified, the files in the Type* folders point to the right file.

How can I achieve this in SVN? Is there any other alternative way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

一抹微笑 2024-12-12 19:24:59

此处查看有关符号链接的 Subversion 文档。

引用链接页面,强调我的:

版本控制符号链接

在非 Windows 平台上,Subversion 能够对以下版本的文件进行版本控制:
特殊类型的符号链接(或“符号链接”)。符号链接是一个文件
充当对某些其他对象的透明引用
文件系统,允许程序读取和写入这些对象
通过对符号链接本身执行操作来间接实现。

当符号链接提交到 Subversion 存储库时,Subversion
记得该文件实际上是一个符号链接,以及该对象
符号链接“指向”的地方。当该符号链接被签出到
Subversion 重建非 Windows 系统上的另一个工作副本
来自版本化符号链接的真正文件系统级符号链接。但
这不会以任何方式限制工作副本的可用性
Windows 等不支持符号链接的系统。在这样的系统上,
Subversion 只是创建一个常规文本文件,其内容是
原始符号链接指向的路径
。虽然该文件不能
在 Windows 系统上用作符号链接,它也不会阻止
Windows 用户执行其他与 Subversion 相关的操作
活动。

Take a look at the subversion documentation on symbolic links here.

Quote from linked page, emphasis mine:

Versioning Symbolic Links

On non-Windows platforms, Subversion is able to version files of the
special type symbolic link (or “symlink”). A symlink is a file that
acts as a sort of transparent reference to some other object in the
filesystem, allowing programs to read and write to those objects
indirectly by way of performing operations on the symlink itself.

When a symlink is committed into a Subversion repository, Subversion
remembers that the file was in fact a symlink, as well as the object
to which the symlink “points.” When that symlink is checked out to
another working copy on a non-Windows system, Subversion reconstructs
a real filesystem-level symbolic link from the versioned symlink. But
that doesn't in any way limit the usability of working copies on
systems such as Windows that do not support symlinks
. On such systems,
Subversion simply creates a regular text file whose contents are the
path to which to the original symlink pointed
. While that file can't
be used as a symlink on a Windows system, it also won't prevent
Windows users from performing their other Subversion-related
activities.

沙与沫 2024-12-12 19:24:59

您可以使用文件外部在 Subversion 中进行软件链接。

svn:external 属性添加到您想要保存文件的文件夹。该属性应如下所示:

..\File1.doc  File1.doc
..\File2.doc  File2.doc
..\File3.xls  File4.xls

第一列是原始文件的路径。第二列是文件的本地名称。

警告在您的工作副本中,这些文件将不会同步。即,如果您更改其中之一,则第二个不会更改,直到您提交更改并更新工作副本。如果您要更改这两个文件,则会产生冲突并且您将无法提交。

You can do software links in subversion using file externals.

Add svn:external property to the folder you want your files in. The property should look like this:

..\File1.doc  File1.doc
..\File2.doc  File2.doc
..\File3.xls  File4.xls

The first column is the path to original file. The second column is the local name of the file.

Warning In your working copy these files won't be synchronized. I.e if you change one of them, the second won't change until you commit the changes and update your working copy. If you will change both files, it will create a conflict and you won't be able to commit.

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