SVN:“树冲突已经存在”,但在我尝试合并之前没有

发布于 2024-08-22 21:44:23 字数 352 浏览 12 评论 0原文

我从 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 技术交流群。

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

发布评论

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

评论(3

漫雪独思 2024-08-29 21:44:23

看起来这个来源是一个我以不符合 SVN 喜好的方式重命名的文件夹。我没有使用 svn move 命令,而是在本地重命名了该文件夹,使用 svn remove 删除了旧文件夹名称,并使用 svn add 添加了新文件夹名称。然而,这会产生一个具有旧名称的“幻影文件夹”——它既不存在于工作副本也不存在于存储库中,但 SVN 认为它存在。虚拟文件夹会导致我上面提到的致命树冲突。

以下是我们解决此问题的方法:

  1. 将主干合并到分支中。现在,分支就是您最终希望主干成为的样子。

  2. 创建一个新分支作为主干的克隆。

  3. 将您的工作目录切换到最新的分支(即您最终想要作为主干的分支)。使用 svn diff > update.patch 在那里。

  4. 将 update.patch 复制到新创建的克隆分支的文件夹中。

  5. 将您的工作目录切换到克隆分支的工作目录并应用补丁。克隆分支现在几乎与最新分支相同,但有一个区别:这些隐藏的 svn 文件中没有提及幻影文件夹。

  6. 将克隆分支合并回主干。

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:

  1. Merge the trunk into the branch. The branch is now what you eventually want your trunk to be.

  2. Create a new branch as a clone of the trunk.

  3. 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.

  4. Copy update.patch into the folder of the newly created clone branch.

  5. 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.

  6. Merge the clone branch back into the trunk.

深空失忆 2024-08-29 21:44:23

问题的背景

我对我的工作副本进行了更改,认为如果我不明确“提交”它们,它不会影响我在服务器上的存储库。

为了避免一些警告(不记得了),我使用了几次“更新”。在找到了我自己挖的洞的出路之后,我了解到 “update” 命令的工作方式如下:

  1. 如果工作副本被修改/最新,它将提交到存储库。
  2. 如果仓库是最新的,它的工作方式就像“结账”(据我所知)。

我正在使用 2 个分支(devalpha)。我想将 dev 分支合并到 alpha 中。

用于修复

  1. 更新我的alpha到我有意提交的修订版、
  2. 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:

  1. if working copy is modified/latest, it will commit to the repo.
  2. if the repo is latest, it will kind of work like "checkout" (as far as I can understand).

I am using 2 branches (dev and alpha). And I wanted to merge dev branch into alpha.

Steps used to fix

  1. update my alpha to the revision which I intentionally committed,
  2. merged dev into alpha.

Note: I was using SmartSVN.

追我者格杀勿论 2024-08-29 21:44:23

我有同样的问题。我右键单击并选择恢复。这解决了所有合并冲突问题。

I had the same issue. I right-clicked and chose to revert. That resolved all merge conflict issues.

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