问题描述
我一直在使用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]
branches/TRY-XX-Foo/test.txt@r3
.将trunk
分支到TRY-XX-Foo
:
A
[EOF]
branches/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]
branches/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
的merge.我最终出现在工作目录中的是一个冲突.
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路合并.我听说过三项合并"一词,所以我做了一下超越比较.通过TortoiseSVN的快速设置,编辑冲突"现在会显示以下屏幕.这并不完美,因为它仍然需要人工干预,但是至少我可以分辨出哪些变化来自何处.
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:当在分支中进行多个连续更改时,如何仅将特定修订合并到主干中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!