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

查看:99
本文介绍了当在两个分支上添加文件时,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书(适用于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

此测试会进行合并,该合并会将没有历史记录的文件添加到 现有版本文件.
这应该是'local obstruction, incoming add upon merge'品种文件上的树冲突.固定了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"中手动合并这些文件(使用外部diff工具).

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

如果您仍在源分支上工作,理想的情况是从源分支B1中删除该文件,从B2合并回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天全站免登陆