在 Subversion 中合并分支时防止冲突 [英] conflicts prevention while merging branches in Subversion

查看:36
本文介绍了在 Subversion 中合并分支时防止冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在 Subversion 中观察到一个非常奇怪的合并冲突.我使用乌龟 SVN 作为客户端.请查看以下Trunk及分行详情:

I have recently observed a very weird merge conflict in Subversion. I am using tortoise SVN as the client. Please find the below information of the Trunk and branch details:

  • \trunk\ .有两个用户正在处理此问题.
  • \QA\ 是从主干合并的分支.
  • 为简单起见,\trunk\ClassLibrary1.sln 中有一个 Visual Studio 解决方案
  • 解决方案中目前有一个示例项目.\trunk\ClassLibrary1
  • 两个用户都已完全更新,没有任何工作副本更改.
  • 将发生以下事件.
  1. 用户 1 将首先在解决方案中添加一个新项目并提交整个目录.( ClassLibrary11 )
  2. 用户 2 将进行更新并在解决方案中添加一个新项目并提交整个目录结构 (ClassLibrary12)
  3. 上下文:在上面的添加中,ClassLibrary11 是我们的特征 X,ClassLibrary12 是我们的特征 Y.现在特征 Y 是稳定的,完全独立于特征 X,可以移动到 QA 分支.
  4. 合并过程:我们进入QA分支,将主干中的特征Y合并到QA分支.它成功合并,没有任何冲突.
  5. 经过 3 周的开发,特性 X 变得稳定,现在我们尝试将特性 X 移至 QA 分支.但是当我们合并时,它会给我们 ClassLibrary.sln 文件中的合并冲突

意图:我们希望将整个过程自动化,作为我们 Devops 管道的一部分,其中功能(完全独立的)可以从仪表板提升到不同的分支,仪表板将合并链接到功能的修订.在上述情况下,特征 X 和特征 Y 是完全独立的(在功能和代码文件方面也是如此).唯一的共同点是解决方案文件 ClassLibrary.sln 文件中添加了对这两个项目的引用.

The Intent : We want to automate the entire process as part of our Devops pipelines where features(which are completely independent) can be promoted to different branches from a dashboard which would merge revisions linked to features. In the above case feature X and feature Y are completely independent (functionally and code file wise as well). The only common point is that solution file ClassLibrary.sln file in which references to both the projects were added.

Tortoise SVN 应该自动发现修订版只是对 2 个不同提交的重新排序.所以我只想知道一种方法(重新设计/预防性提交),以免发生此类冲突.如果它们应该发生,那么我需要知道在合并功能 Y 即 ClassLibrary12 时,这会在未来引起冲突

Tortoise SVN should have automatically figured it out that the revision was a just a reordering of 2 different commits. So I just want to know a way (redesign/preventive commit) so that such conflicts dont happen. And if they should happen then I need to know that while merging the Feature Y i.e. ClassLibrary12 that this would cause conflicts in future

推荐答案

解决冲突的过程不可能自动化.如果可能,那么 SVN 会为您做,但事实并非如此,所以它不能.总得有人来解决冲突.现在你可能想知道为什么会发生冲突,但我认为这不是一个重要的问题.没关系.重要的是您对自动解决冲突的期望是不现实的.做不到.

It is not possible to automate the process of resolving conflicts. If it were possible then SVN would do it for you, but it's not, so it can't. There always has to be a human to resolve conflicts. Now you may wonder why the conflict happened, but I don't think that's an important question here. It does not matter. What matter is that your expectations about automatic conflicts resolving are not realistic. It can't be done.

这篇关于在 Subversion 中合并分支时防止冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆