简体   繁体   English

告诉 svn(乌龟)某个分支已经合并

[英]Telling svn (tortoise) that a certain branch has already been merged

In a project I'm working on, we have a problem with branching/merging.在我正在进行的一个项目中,我们在分支/合并方面遇到了问题。

To simplify, we have a branch A (owned by our client) and a branch B (owned by us), and we periodically syncronize A with B so all new changes made at B are brought to A when the client says so (when client certifies that code at branch B have been properly tested, execution works properly, etc).为简化起见,我们有一个分支 A(由我们的客户拥有)和一个分支 B(由我们拥有),并且我们定期将 A 与 B 同步,以便当客户这么说时(当客户证明分支 B 的代码已经过正确测试,执行正常等)。

The problem is that sometimes merging is done in an incorrect way so SVN doesn't know which commits has been already merged and which doesn't.问题是有时合并的方式不正确,所以 SVN 不知道哪些提交已经合并,哪些没有。 The changes and the ways conflicts have been solved are correct, functionally spoken, but SVN doesn't know that.更改和解决冲突的方式是正确的,从功能上讲是正确的,但 SVN 不知道这一点。 So if you try to merge all revisions from two branches already merged, all previously solved conflicts appear again.因此,如果您尝试合并来自已合并的两个分支的所有修订,则所有先前解决的冲突会再次出现。 If I specify the option "include merged revisions", in SVN log, some "merging commits" doesn't unfold to show all the commits that are included in such merges.如果我指定选项“包含合并的修订”,在 SVN 日志中,某些“合并提交”不会展开以显示此类合并中包含的所有提交。 That's how I know that this metadata has been lost.这就是我知道这个元数据已经丢失的方式。

I think the problem is that sometimes some people request the merge in a local copy, and the conflicts are manually solved in another local copy so after committing from such copy the SVN server doesn't receive the metadata that was generated when you requested the merge in the first place.我认为问题是有时有些人在本地副本中请求合并,而冲突是在另一个本地副本中手动解决的,因此从此类副本提交后,SVN 服务器不会收到您请求合并时生成的元数据首先。

So you cannot just "synchronize branches" from B to A, because the situation is unmaintenable.所以你不能只是“同步分支”从 B 到 A,因为这种情况是不可维护的。 The only option left is to manually specify the range of revisions to merge, but we don't want to do this anymore.剩下的唯一选择是手动指定要合并的修订范围,但我们不想再这样做了。

So, how can we say to SVN, "hey, all of the changes from B have already been merged, and the conflicts have been solved in A, despite what you think"?那么,我们怎么能对 SVN 说:“嘿,不管你怎么想,B 的所有变化都已经合并了,A 中的冲突已经解决了”?

NOTE: We use Tortoise SVN.注意:我们使用 Tortoise SVN。

In the third page of the merge wizard there is a checkbox "Only record the merge (block revisions from getting merged)".在合并向导的第三页中,有一个复选框“仅记录合并(阻止合并的修订)”。 Check it.核实。 The result would be to just write revisions to svn:mergeinfo property.结果只是将修订写入svn:mergeinfo属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM