SVN:“树冲突已经存在”,但在我尝试合并之前没有
我从 SVN 收到此错误消息:
svn:尝试添加已存在的树冲突
现在,这个网站上已经有人问过这个问题,给出的解释是在先前的合并之后树冲突尚未解决,现在 SVN 正在尝试再次添加相同的树冲突。
所以我调用了“svn status”并将所有树冲突标记为已解决。然后我做了 *svn revert -R ** 并仔细检查“svn status”的输出是否完全为空。然后我再次尝试合并,在完全相同的位置出现完全相同的错误消息。
在我看来,svn 试图在同一个合并操作期间两次在同一个地方添加树冲突,恕我直言,这将是 SVN 中的一个严重错误。
I get this error message from SVN:
svn: Attempt to add tree conflict that already exists
Now, this has already been asked on this site and the given explanation is that a tree conflict has not been resolved after a previous merge, and now SVN is trying to add the same tree conflict again.
So I called "svn status" and marked all tree conflicts as resolved. I then did *svn revert -R ** and double-checked that the output of "svn status" is completely empty. I then tried the merge again, with the exact same error message at the exact same place.
It seems to me like svn tries to add a tree conflict in the very same place twice during the same merge operation, which, with all due respect, would be a severe bug in SVN.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来这个来源是一个我以不符合 SVN 喜好的方式重命名的文件夹。我没有使用 svn move 命令,而是在本地重命名了该文件夹,使用 svn remove 删除了旧文件夹名称,并使用 svn add 添加了新文件夹名称。然而,这会产生一个具有旧名称的“幻影文件夹”——它既不存在于工作副本也不存在于存储库中,但 SVN 认为它存在。虚拟文件夹会导致我上面提到的致命树冲突。
以下是我们解决此问题的方法:
将主干合并到分支中。现在,分支就是您最终希望主干成为的样子。
创建一个新分支作为主干的克隆。
将您的工作目录切换到最新的分支(即您最终想要作为主干的分支)。使用 svn diff > update.patch 在那里。
将 update.patch 复制到新创建的克隆分支的文件夹中。
将您的工作目录切换到克隆分支的工作目录并应用补丁。克隆分支现在几乎与最新分支相同,但有一个区别:这些隐藏的 svn 文件中没有提及幻影文件夹。
将克隆分支合并回主干。
It seems like the source of this was a folder that I renamed in a way that is not to SVN's liking. Instead of using the svn move command, I renamed the folder locally, deleted the old folder name with svn remove and added the new one with svn add. However, this spawns a "phantom folder" that has the old name - it exists neither in the working copy nor in the repository, but SVN thinks it exists. A phantom folder causes the fatal tree conflict I mentioned above.
Here is how we solved this:
Merge the trunk into the branch. The branch is now what you eventually want your trunk to be.
Create a new branch as a clone of the trunk.
Switch your working directory to the up-to-date branch (i.e. the one you eventually want as the trunk). Use
svn diff > update.patch
there.Copy update.patch into the folder of the newly created clone branch.
Switch your working directory to that of the clone branch and apply the patch. The clone branch is now nearly identical with the up-to-date-branch, with one difference: There is no mention of the phantom folder in those hidden svn files.
Merge the clone branch back into the trunk.
问题的背景
我对我的工作副本进行了更改,认为如果我不明确“提交”它们,它不会影响我在服务器上的存储库。
为了避免一些警告(不记得了),我使用了几次“更新”。在找到了我自己挖的洞的出路之后,我了解到 “update” 命令的工作方式如下:
我正在使用 2 个分支(dev 和 alpha)。我想将 dev 分支合并到 alpha 中。
用于修复
注意:我使用的是 SmartSVN。
Background of the problem
I had made changes to my working copy thinking that if I don't explicitly "commit" them, it won't affect my repo on server.
And to fend-off some warning (don't remember), I used "update" couple of times. After finding my way out of this hole which I myself dug, I understand that "update" command works in following way:
I am using 2 branches (dev and alpha). And I wanted to merge dev branch into alpha.
Steps used to fix
Note: I was using SmartSVN.
我有同样的问题。我右键单击并选择恢复。这解决了所有合并冲突问题。
I had the same issue. I right-clicked and chose to revert. That resolved all merge conflict issues.