SVN删除头疼我做错了什么? [英] SVN delete headache what am I doing wrong?
问题描述
假设我在工作副本中并执行以下操作,我完全感到困惑:
I am totally confused assuming I am in a working copy and do the following:
svn mkdir trunk
svn mkdir tags
svn mkdir branches
svn commit -m "added trunk branches and trunk"
cd trunk
touch a b c d e f g
svn add a b c d e f g
cd ..
svn commit -m "added files"
svn copy trunk tags/1.0
svn commit -m "tagged 1.0"
现在我想删除一个文件并标记另一个版本
Now I want to delete a file and tag another version
svn delete trunk/e
svn commit -m "deleted file e"
svn copy trunk tags/1.1
svn commit -m "created tag 1.1"
我收到类似于以下内容的错误消息:
I get an error message similar to the following:
/svn/repos/banana/!svn/wrk/1f39512a-0e1e-11e0-9d1f-5be991158436/63885/tags/1.1/e'找不到路径
/svn/repos/banana/!svn/wrk/1f39512a-0e1e-11e0-9d1f-5be991158436/63885/tags/1.1/e' path not found
我到底做错了什么?
更新:
我发现如果我在删除后执行 svn update 一切正常.我想解释一下这种行为.
I found that if I do an svn update after the delete everything works fine. I would like an explanation for this behavior.
推荐答案
这显然是 Subversion 的一个已知问题,在提交后处理删除时.当您提交时,您的工作副本将成为混合修订工作副本,然后不允许提交删除.
This apparently is a known issue with Subversion, when working with deletes after commits. When you commit, your working copy becomes a mixed revision working copy, which then does not allow commits of deletes.
您可以通过在执行更新/提交之前运行 svnversion
来验证这一点.您会注意到混合修订版标有0:4"之类的工作副本版本.
You can verify this by running svnversion
before you do the updates/commits. You will notice the mixed revision is marked by a working copy version of something like "0:4".
来自 Subversion 最佳实践文档:
From the Subversion best practices document:
您的工作副本的目录和文件可以处于不同的工作"修订版:这是一个有意的功能,它允许您将旧版本的东西与新的东西混合和匹配.但有几个事实你必须知道:
Your working copy's directories and files can be at different "working" revisions: this is a deliberate feature which allows you to mix and match older versions of things with newer ones. But there are few facts you must be aware of:
- 每次 svn 提交后,您的工作副本都有不同的修订版本.您刚刚提交的内容现在处于 HEAD 修订版中,而其他所有内容都处于较旧的修订版中.
- 某些提交是不允许的:
- 您不能提交没有 HEAD 工作修订版的文件或目录的删除.
- 您不能将属性更改提交到没有 HEAD 工作修订版的目录.
书籍参考:混合修订的限制.
在这篇关于混合修订工作的文章中也很好地解释了这一点副本.
这篇关于SVN删除头疼我做错了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!