Reputation: 81
Our server is running subversion 1.8.10. Our clients use 1.8+. We mostly use TortoiseSVN (so I will describe using tortoise terms), version 1.8+.
Our (common) subversion workflow is:
This all works perfectly fine.
We have run into situations in which, say, BranchA has some changes (e.g. adds some files). It is up to date (from trunk) and going through code review before it gets merged back into the trunk. BranchB is created (from trunk) and would like to get the changes from BranchA in order to build forth from them.
If we MRoR from BranchA to BranchB, we get the changes as we would expect. We can merge BranchA as many times as we like, we can also MRoR from trunk into BranchA or BranchB.. all seems fine.
BranchA can be merged back into trunk (using MTDT), works fine. However, once we MRoR trunk into BranchB again, after BranchA's merge, we get tree conficts. Why is this? SVN is tracking the merge history, it can see BranchA is who created/moved/etc files. If I do the same process, but instead use MTDT to merge from BranchA to BranchB, the outcome is the exact same. This still happens even if BranchB has no changes of its own.
What is the proper way to merge from BranchA into BranchB such that no tree conflicts arise, upon next MRoR from trunk to BranchB, after BranchA has been merged back into trunk?
This sort of thing is easily done in git. I'm sure that there should be a way to get around the tree conflicts.
Thanks for any help!
Upvotes: 0
Views: 1451
Reputation: 81
I've done some testing and have it figured out. I'll go ahead and share how to do this, in case more people out there have the same issue.
To recap:
The tree conflicts actually make sense, when you think about it. From BranchB's perspective, it gets some files modified from the merge from BranchA, then again from the merge from trunk. Thus, tree conflict. The issue is that the merge that is coming from the trunk does not let BranchB know that BranchA has been merged into trunk. There are actually two ways to fix this.
If it's not made clear, just go with Method 2.
I know that this is a bit of an advanced SVN workflow. But, I hope that this explaination has helped someone else who has had similar issues.
TortoiseSVN merge strategy source: https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-merge.html
Upvotes: 1
Reputation: 97395
You must to own fix weakness and errors in workflow before going deeper:
svn help merge
form. 1)AFAICR, even with correct workflow for "circular" merges (A->B->C->A) mysterious tree-conflicts (before and in TSVN 1.8.11) some time ago (your experience now may differ) and finished with merging branches in Mercurial (that included handwork of replacing WC of SVN-target by content of Working Directory of Mercurial - Mercurial can interact with SVN bidirectionally, but stll can't push own mergesets into SVN-repo) and manual editing of mergeinfo in SVN
Upvotes: 0