颠覆外部问题
我是 SVN 新手,并且大量使用 externals 属性。 我的电脑上有一个存储库,外部属性的名称中有一个硬编码的“localhost”,这现在给我带来了问题。 例如:
/project1/trunk
/shared/trunk
project1/trunk
依赖于共享文件夹,因此具有 svn://localhost/shared/trunk 的 svn:externals
属性。 这与 TortoiseSVN 配合得很好,我可以签出 project1/trunk
并获得 shared/trunk
的副本。
现在我已将存储库移至另一台服务器,并且由于明显的原因,外部链接不再起作用(TortoiseSVN 正在尝试签出不再存在的 svn://localhost/shared/trunk )。
所以我需要更新我的所有外部 - 但我不想硬编码任何机器名称 - 那么我该如何使其工作? 请记住,存储库可能会在某个时候再次移动。 在深入研究 SVN 手册时,我遇到了 ^/ 语法,因此我尝试了以下操作:
svn:externals shared ^/shared/trunk
这是被接受的,但是当我尝试在我的 PC 上签出 project1
的副本时,我发现出现以下错误:
Unrecognized format for the relative external URL 'shared'.
Check the path and/or URL you've entered.
除非我在外部对存储库计算机名称进行硬编码,否则我无法完成这项工作 - 这似乎是一种黑术,因此欢迎任何建议。
I am new to SVN and make heavy use of the externals property. I have a repository located on my PC and the externals properties have a hardcoded 'localhost' in the name, which is now giving me problems. For example:
/project1/trunk
/shared/trunk
project1/trunk
depends on the shared folder so has an svn:externals
property of svn://localhost/shared/trunk. This works fine with TortoiseSVN and I can checkout project1/trunk
and am given a copy of shared/trunk
.
Now I have moved the repository to another server and the externals links no longer work for obvious reasons (TortoiseSVN is trying to checkout out svn://localhost/shared/trunk
which no longer exists).
So I need to update all my externals - but I don't want to hardcode any machine names - so how do I make this work? Bear in mind that the repository may move again at some point. Digging around the SVN manuals I came across the ^/ syntax, so I tried the following:
svn:externals shared ^/shared/trunk
This was accepted but when I try and checkout a copy of project1
on my PC I get the following error:
Unrecognized format for the relative external URL 'shared'.
Check the path and/or URL you've entered.
Unless I hardcode the repository machine name in the externals I can't make this work - it seems like a black art so any advice would be welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您引用的 ^/ 语法是 SVN 1.5 中的新语法,因此您可能使用不理解该语法的旧版本客户端和/或服务器。 此外,为了支持 1.5 中新的外部语法,他们更改了外部定义中参数的顺序。 我认为您首先需要路径,然后是它出现在下面的文件夹名称。 详细信息位于文档中。
The ^/ syntax you refer to is new in SVN 1.5, so you may be using an older version of the client and/or server that doesn't understand that syntax. Also, in order to support the new externals syntax in 1.5, they changed the order of the paramters in the externals definition. I think you want the path first, then the folder name for it to appear under. The details are in the docs.