在 svn 存储库中添加符号链接后,我不断在该目录内收到错误
我创建了从 /www/dir2/ 到 /home/dir2/ 的符号链接 然后我将其添加到存储库( svn add /www/dir2/ ) 现在,如果我进入该目录,并尝试在其中使用 svn 执行任何操作,我会收到“svn: warning: '.'” 不是工作副本”错误。
如果我尝试添加子目录 (svn add /www/dir2/dir5 ),我会收到错误:
svn:“dir2”不是工作副本
svn:无法打开文件“dir2/.svn/entries”:没有这样的文件或目录 我尝试提交目录添加,效果很好
从日志中:
更改路径:
/www/dir2
svn pl dir2/
“dir2”的属性:
svn:special
任何帮助将不胜感激。 谢谢!
I created a symbolic link from /www/dir2/ to /home/dir2/
I then added it to the repository ( svn add /www/dir2/ )
Now if I go into that directory, and try to do anything with svn in there I receive a "svn: warning: '.' is not a working copy" error.
If I try to add a subdirectory (svn add /www/dir2/dir5 ) I receive the error:
svn: 'dir2' is not a working copy
svn: Can't open file 'dir2/.svn/entries': No such file or directory
I tried committing the directory addition and that worked fine
From the log:
Changed paths:
A /www/dir2
svn pl dir2/
Properties on 'dir2':
svn:special
Any help would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Subversion 不遵循符号链接。 提交符号链接后,它会作为常规文件存储在数据库中,并且设置了 svn:special 属性。 请参阅手册了解更多信息。
如果您想将该目录添加到存储库中,则必须将其移动(而不是符号链接)到您的工作副本中,然后添加它。
Subversion does not follow symbolic links. When a symlink is committed, it is stored in the database as a regular file with the
svn:special
property set. See the manual for more information.If you want to add that directory to the repository, you will have to move (not symlink) it in to your working copy and then add it.
另一种选择(通常仅当您有一个希望 svn 遵循的符号链接目录时)是使用类似以下内容的内容:
mount --bind /real/path/to/dir /path/inside/working/dir
然后您可以添加该内容没有问题的存储库路径。
在大多数情况下,仅移动目录是一个更好的主意(它不会弄乱 fstabs,您不必一直重新安装它,等等)——但我想我应该传递一个可以节省时间的提示您不会仅仅以提交的名义将目录加倍。
An alternative (usually only if you have a directory symlinked that you hoped svn would follow) would be to use something like:
mount --bind /real/path/to/dir /path/inside/working/dir
You could then add that path to the repo without problems.
In most cases, just moving the directory is a better idea (it won't clutter up fstabs, you won't have to remount it all the time, etc) -- but I figured I'd pass a tip along that can save you from doubling a directory just in the name of committing it.