1

I'm currently using TortoiseSVN to do a merge of two branches and I've found that its not smart enough to handle a specific merging senario.

In one branch I have a method as follows:

MyMethod(parameter1, parameter2, parameter3)

In the other branch I have the same method as follows:

MyMethod(parameter1, parameter2, parameter4)

TortoiseMerge notices that there is a conflict but only gives me the option of using one method signature or the other. However, what I really want is to merge it into a single method with all four parameters as follows:

MyMethod(parameter1, parameter2, parameter3, parameter4)

The only way I can get around this conflict at the moment is to resolve the line so that both methods are present and then manually go to the file and correct it after the conflict has been resolved.

Is this just the way things are or is there a smarter merge tool out there somewhere that would be able to handle this scenario?

4

5 回答 5

3

I don't get it? Your project won't compile, or worse, won't run correctly after the merge because the method signature you want is not in either branch. Isn't this more dangerous than a conflict? Perhaps I've missed something obvious.

IMHO TortoiseSVN (or rather the SVN client) is doing the right thing in reporting a conflict, it needs human intervention.

于 2009-10-23T01:27:37.007 回答
0

AFAIK,除了将其报告为冲突之外,没有合并工具可以在这些情况下提供帮助

您希望该工具将其合并为具有所有 4 个参数的单个函数调用。

我的方法(参数 1,参数 2,参数 3,参数 4)

这里也出现了是否先放置参数 3 再放置参数 4 或反之亦然的歧义。

于 2009-12-27T18:00:00.167 回答
0

Araxis Merge is popular for its power. Personally I like SourceGear DiffMerge since its more free'er.

于 2009-10-23T01:19:39.737 回答
0

到目前为止,我还没有找到任何可以自动完成我要求的工具。这甚至可能是不可能的。但我找到了一个我认为我会报告的解决方法。

我最终安装了perforce 视觉合并,我发现它比 Tortoise svn 提供的默认合并工具更好。我发现的一个很好的功能,我不记得是否有乌龟合并,它允许人们查看和编辑合并的结果。因此,即使它不能自动合并我想要的行,我也可以就地编辑冲突,而不是错误地解决它并在合并后手动更新它。

于 2010-02-10T12:19:26.490 回答
0

我确信 TortoiseSVN 无法处理这个问题。更广泛地说,任何其他基于文本的合并/差异工具都不能:请记住,这些工具与您使用的语言无关,它们无法从语义上理解您的代码。他们只是进行“逐个字符”比较,而不像编译器那样实际阅读或赋予这些字符所表达的含义。

如果您使用的语言在某种程度上是合法的,也许您可​​以检查是否有与该语言相关的内容。

至于在合并时进行编辑的能力,TortoiseSVN 实际上可以做到这一点。

于 2016-06-15T09:17:16.570 回答