SVN如何在两个分支上添加文件时解决新的树冲突 [英] SVN how to resolve new tree conflicts when file is added on two branches

查看:22
本文介绍了SVN如何在两个分支上添加文件时解决新的树冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当合并几个分支(使用 SVN 1.6.1)时,在两个分支上都添加了一个文件(然后在这些单独的分支中处理)时,我遇到了一个新的树冲突:

When merging a couple of branches (using SVN 1.6.1) where a file has been added on both branches (and then worked on in those separate branches) I'm getting one of the new tree conflicts:

      C foo.txt
  >   local obstruction, incoming add upon merge

我需要两个分支的更改,但是树冲突没有给我通常的 .working、.merge-left &.merge-right 文件 - 由于冲突的性质,这是可以理解的.这种冲突有很多,每个分支上都发生了相同文件的删除,但解决起来很简单.

I need the changes from both branches, but the tree conflict doesn't give me the usual .working, .merge-left & .merge-right files -- which is understandable due to the nature of the conflict. There are quite a few of these conflict, and ones where a delete of the same file has occurred on each branch, but they're simple to resolve.

我该如何解决这个问题?SVN redbean book (for 1.6) 没有涵盖这种情况.

How can I resolve this issue? The SVN redbean book (for 1.6) doesn't cover this situation.

推荐答案

正如在 树冲突"设计文档:

合并添加版本化文件导致的 XFAIL 冲突

XFAIL conflict from merge of add over versioned file

此测试进行合并,将没有历史记录的文件添加到现有版本文件.
这应该是'本地阻塞,传入添加后合并'变种的文件上的树冲突.修复了 r35341 中的预期.

This test does a merge which brings a file addition without history onto an existing versioned file.
This should be a tree conflict on the file of the 'local obstruction, incoming add upon merge' variety. Fixed expectations in r35341.

(顺便提一下,这在 ClearCase 中也被称为邪恶双胞胎"):
一个文件在两个不同的分支中创建了两次(这里是添加"了两次),为两个不同的元素创建了两个不同的历史,但名称相同.

(This is also called "evil twins" in ClearCase by the way):
a file is created twice (here "added" twice) in two different branches, creating two different histories for two different elements, but with the same name.

理论上的解决方案是在目标分支B2"中手动合并这些文件(使用外部差异工具).

The theoretical solution is to manually merge those files (with an external diff tool) in the destination branch 'B2'.

如果您仍在源分支上工作,理想的情况是从源分支 B1 中删除该文件,然后从 B2 合并回 B1 以使该文件在 B1 上可见(然后您将处理相同的元素).
如果由于合并只发生在 B1B2 处而无法进行回合并,那么每个 B1->B2 都需要手动合并> 合并.

If you still are working on the source branch, the ideal scenario would be to remove that file from the source branch B1, merge back from B2 to B1 in order to make that file visible on B1 (you will then work on the same element).
If a merge back is not possible because merges only occurs from B1 to B2, then a manual merge will be necessary for each B1->B2 merges.

这篇关于SVN如何在两个分支上添加文件时解决新的树冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆