svn merge left, right & 之间的区别冲突后的工作文件
当从我的开发团队的主干执行“svn 合并”到分支时,我们偶尔会遇到合并冲突,产生带有后缀名的文件:*.merge-right.r5004
、*.merge- left.r4521
和 *.working
。我搜索了整个 Subversions 的文档,但他们的解释并没有多大用处。我收集了以下内容:
- *.merge-right.r5004 = trunk 版本
- *.merge-left.r4521 = ?
- *.working = 分支版本
我似乎无法弄清楚 merge-left.r4521
是什么。如果答案是它只是分支中文件的旧版本,那么为什么是 4521?
When performing a 'svn merge' from my development team's trunk into a branch, we occasionally experience merge conflicts that produce files with suffix names: *.merge-right.r5004
, *.merge-left.r4521
and *.working
. I've searched throughout Subversions's documentation but their explanation hasn't been much use. I've gathered the following:
- *.merge-right.r5004 = trunk version
- *.merge-left.r4521 = ?
- *.working = branch version
I can't seem to figure out what merge-left.r4521
is. And if the answer is that its simply an older version of the file from branch, then why 4521?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
假设有两个分支,分支
A
中的最后一个 (HEAD
) 修订版是9
,而它是6
> 在分支B
中。当
cd B 时; svn merge -r 5:8 ^/braches/A
运行后,svn 将尝试在分支A< 的
5
和8
之间应用增量/code> 位于分支B
顶部。(换句话说,更改集
7
和8
将应用于B
)如果增量应用干净,那就一切都很好。
假设某些行在更改集
3
中进行了修改,并且相同的源代码行在更改集4
中进行了不同的修改。如果 delta (
5
→8
) 没有触及这些线,那么一切仍然很好。如果 delta (
5
→8
) 也修改了3
和4
所做的事情,则更改无法自动合并,并且svn 使文件处于冲突状态:file
--- 以 (working
,left
,right
) 分隔的文件file.working
--- 分支中文件的状态B@6
file.merge-left
--- 分支中文件的状态A@5
file.merge-right --- 分支中的文件状态
A@8
如果您手动编辑这样的文件,您有几个选择 --- 继续工作(您的版本),保持
正确
(他们的版本;其他分支版本)或手动合并更改。Left
本身没有用,没有必要在文件中保留left
(他们的旧版本)。然而,它对于工具很有用。
left
→right
是变更集。例如,当您看到:
在分支
A
中,"13"
(str) 更改为"42"
。分支
B
有13
(int)。当您手动协调此冲突时,也许您需要
42
(int)。Let's say there are two branches, and last (
HEAD
) revision in branchA
is9
, while it is6
in branchB
.When
cd B; svn merge -r 5:8 ^/braches/A
is ran, svn will try to apply delta between5
and8
from branchA
on top of branchB
.(In other words, change sets
7
and8
will be applied toB
)If the delta applies cleanly, it's all good.
Let's say some lines were modified in change set
3
, and same source lines were modified differently in change set4
.If delta (
5
→8
) doesn't touch those lines, all is still good.If delta (
5
→8
) also modified what3
and4
did, changes cannot be merged automatically, and svn leaves a file in conflict state:file
--- file with (working
,left
,right
) delimitedfile.working
--- state of file in branchB@6
file.merge-left
--- state of file in branchA@5
file.merge-right
--- state of file in branchA@8
If you edit such a file manually, you have a few choices --- keep
working
(your version), keepright
(their version; the other branch version) or merge the changes manually.Left
is not useful in itself, there's no point to keepleft
(their old version) in the file.It is, however, useful for tools.
left
→right
is the change set.When you see, for example:
In branch
A
,"13"
(str) was changed to"42"
.Branch
B
had13
(int).Perhaps you want
42
(int) when you reconcile this conflict manually.file.merge-left.r4521 是创建右分支(目标)之前左分支(即源)中该文件的最新更改。
换句话说,merge-left.r4521是要
与merge-right.r5004(目标分支的最新版本)
合并的文件的第一个版本例如,假设您要合并分支左、右如下:
file.merge-left.r4521 is the latest change of this file in the left branch (i.e. the origin) before the right branch (the destination) were created.
In other words, merge-left.r4521 it's the first version of the file to be merged
with merge-right.r5004 (the latest version of the destination branch)
For example, say you want to merge branches Left and Right as below:
这个问题类似于 stackoverflow.com/questions/1673658/svnmerge-workflow 但这一个更具体地说明了冲突文件的内容。
This question is similar to stackoverflow.com/questions/1673658/svnmerge-workflow but this one is more specific about the content of the conflict files.
似乎“左”文件是最后一个版本,其中文件在主干和分支中相同(对于您的问题,但通常位于源和目标之间)。
如果您从未将主干中的更改合并到分支中,那么这将是执行分支(复制)时主干的版本。否则,它是合并并提交到此分支的主干的最后一个版本。
左侧和右侧用于创建将(作为补丁)应用到工作文件的差异。
It seems that the "left" file is the last version where the file was the same in the trunk and the branch (for your question, but it would be between the source and dest in general).
If you've never merged changes from the trunk into your branch then this would be the version of the trunk when a branch (copy) was performed. Otherwise, it's the last version of the trunk that was merged and committed to this branch.
The left and right are what is used to create the diff that will be applied (as a patch) to the working file.
您执行了 3 边合并以解决冲突(当合并2 个不同的文件时)。此操作 3 个源使用了
r* ** 扩展名刚刚添加到相同的文件名中,以便合并 3 个文件
成功合并并将冲突标记为已解决的临时文件后,如果我的记性不错的话,临时文件必须自动消失
You performed 3-side merge diring conflict-resolving (when merging 2 different files). It this operation 3 sources used
r*** extension just added to the same filename in order to have 3 files on merge
After successful merging and marking conflict as resolved temp-files must disappear automagically, if my memory served me well