conflicts prevention while merging branches in Subversion
Asked Answered
H

1

9

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\ . Two users are working on this.
  • \QA\ is the branch where the merges from the trunk will happen.
  • For simplicity sake, There is a visual studio solution in \trunk\ClassLibrary1.sln
  • There is currently a sample project in the solution. \trunk\ClassLibrary1
  • Both users are fully updated and dont have any working copy changes.
  • Below sequence of events will take place.

  1. User 1 will first add a new project in the Solution and commit the entire directory. ( ClassLibrary11 )
  2. User 2 will take the update and add a new project in the solution and commit the entire directory structure ( ClassLibrary12 )
  3. Context: In the above additions, ClassLibrary11 is our feature X and ClassLibrary12 is our feature Y. Now feature Y is stable, completely independent of the feature X and can be moved to the QA branch.
  4. Merging process : We go to the QA branch and merge the feature Y from the trunk to the QA branch. It merges successfully without any conflict.
  5. After 3 weeks of dev, the feature X becomes stable and now we try to move feature X to the QA branch. But as we merge, it gives us merge conflicts in the ClassLibrary.sln file

enter image description here

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 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

Hagood answered 2/8, 2018 at 15:46 Comment(0)
G
1

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.

Genevagenevan answered 28/6, 2021 at 10:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.