本文介绍了Subversion:在分支中进行多个连续更改时,如何仅将特定修订合并到主干中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 TortoiseSVN、svn 和 subclipse,我想我了解基础知识,但有件事一直困扰着我:合并引入了不需要的代码.这是步骤.

I have been using TortoiseSVN, svn, and subclipse and I think I understand the basics, but there's one thing that's been bugging me for a while: Merging introduces unwanted code. Here's the steps.

trunk/test.txt@r2.使用A"和返回创建了一个测试文件:

trunk/test.txt@r2. A test file was created with 'A' and a return:

A
[EOF]

分支/TRY-XX-Foo/test.txt@r3.将trunk 分支到TRY-XX-Foo:

A
[EOF]

分支/TRY-XX-Foo/test.txt@r4.在 TRY-XX-Foo 中进行了不需要的更改并提交:

branches/TRY-XX-Foo/test.txt@r4. Made an unwanted change in TRY-XX-Foo and committed it:

A
B (unwanted change)
[EOF]

分支/TRY-XX-Foo/test.txt@r5.在 TRY-XX-Foo 中修复了一个重要的错误并提交:

branches/TRY-XX-Foo/test.txt@r5. Made an important bug fix in TRY-XX-Foo and committed it:

A
B (unwanted change)
C (important bug fix)
[EOF]

现在,我只想将重要的错误修复合并回主干.所以,我为修订版 4:5 运行合并.我在工作目录中的最终结果是一个冲突.

Now, I would like to merge only the important bug fix back to trunk. So, I run merge for revision 4:5. What I end up in my working directory is a conflict.

trunk/test.txt:

A
<<<<<<< .working
=======
B (unwanted change)
C (important bug fix)
>>>>>>> .merge-right.r5
[EOF]

违背我的意愿,Subversion 现在在主干代码中包含了不需要的更改",我需要手动清除它们.在分支中进行多次连续更改时,有没有办法仅合并指定的修订版?

Against my will, Subversion has now included "unwanted change" into the trunk code, and I need to weed them out manually. Is there a way to merge only specified revisions when multiple consecutive changes are made in the branch?

问题的一部分是 .merge-right 中包含 B(未预期的更改),我无法区分它来自哪个修订版.我通常使用 TortoiseMerge,这是它的外观.

The part of the problem is that B (unwated change) is included in .merge-right and I can't tell the difference between which revision it came from. I usually use TortoiseMerge and here's how it looks.

推荐答案

问题是两个svn

A
<<<<<<< .working
=======
B (unwanted change)
C (important bug fix)
>>>>>>> .merge-right.r341

和 TortoiseSVN 将这种情况视为 2 路合并.我听说过三向合并这个词,所以我试了一下Beyond Compare.使用 TortoiseSVN 进行快速设置后,Edit Conflict 现在会显示以下屏幕.这并不完美,因为它仍然需要人工干预,但至少我可以分辨出哪些变化来自哪里.

and TortoiseSVN is treating the situation as 2-way merge. I've heard of the term 3-way merge, so I gave Beyond Compare a shot. With quick set up with TortoiseSVN, Edit Conflict now bring up the following screen. This is not perfect, since it's still requiring human intervention, but at least I can tell which changes are coming from where.

查看截图.

这篇关于Subversion:在分支中进行多个连续更改时,如何仅将特定修订合并到主干中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 06:46