Merge from branch to trunk with Merge Revision Range

I have combined several times in Subversion / TortoiseSVN several times:

Method A:

  • 1) I change the connecting line and fix.

  • 2) I make other changes to the branch and commit.

  • 3) In a working copy from the trunk: I merge from the branch using TortoiseSVN "Combine a series of changes."

  • 4) Then I fix the connecting line and delete the branch.

However, TortoiseSVN-manual recommends the following instead of 3) and 4):

Method B:

  • 3 *) In a working copy from the branch: Merge changes from the trunk using TortoiseSVN "Merge revision range".

  • 4 *) Lock the branch, including changes to the outside line.

  • 5 *) In a working copy from the trunk: Merge changes from a branch using TortoiseSVN "Reintegrate Branch".

  • 6 *) Lock the connecting line and remove the branch.

I find it much simpler and did not find a reason why I should not do this.

What are the arguments for method B, or A, when merging with a branch back to the trunk?

+7
branch merge svn trunk
source share
2 answers

This is a β€œ rebasing ” call before merging: you are β€œupdating” (or updating) your local branch with the evolution of the trunk before you merge this local branch back into the trunk.

It allows slow resolution of merging inside your "branch" with possible intermediate commits.
Then, when everything is done, you can do a trivial merge back into the trunk.
Thus, you do not need to postpone commits just because you are merging into a trunk (since only stable commits should be allowed on the trunk).

Don't you consider using the β€œA” approach harmful?

Not if the merger is trivial, with a predicted result. In this case, approach B will be a waste of time, an additional merge that is not required (and you should always try to make as few merges as possible: each of these operations may be error prone)

But if the result is not predetermined, then the β€œB” approach is finally recommended and allows you to explore the result of the merge in your own branch before acting on the β€œtrunk”.

Both approaches are useful; you should not strive to apply only one or only the other, but the most adapted to the situation.

+11
source share

Regarding the range of version merging and branch reintegration:

The following method B leads to two types of commits to branches:

  • Changes the uniqueness for a branch
  • Trunk changes selected from the trunk by executing a consistent range of Merge versions.

When merging with the trunk, you should select only unique changes for the branch. This is done by reintegrating the branch.

Using the Merge version range at the end will result in both duplicated trunk changes and private branch changes being merged into the trunk.

0
source share

All Articles