2

I have two branches. One is created for may month release and another created for august month release.

August branch need to updated with May changes until May branch is locked for making changes.

I am using 'Merge range of revision' option in tortoise. In the revision range, do i need to give 'HEAD' only, as i am going to merge the latest May to August.

Do i need to specify the range from my previous retrofit number? For example, I retrofitted 8123 version of May to August. Now do i need to specify 8123-Head or just HEAD.

What is the difference.?

2 Answers 2

2

If you select only HEAD, than any changes in any revisions prior to HEAD will not be included in the merge. You either need to select ALL the revisions in the branch whose changes are not yet included in your branch, or leave the range specifier empty to allow SVN to figure out which revisions to merge.

Edited to add example

When you do a "range of revisions" merge, you are picking individual CHANGES to cherry-pick over into your merge destination. If you say "merge HEAD" you are not saying "merge all changes up through HEAD", you are saying "merge only the specific change that happened in the very last revision on that branch". Consider a trunk with revision 122; a MayBranch with revisions 123, 124, and 125; and an AugustBranch with revisions 126 and 127. Both branches were copied from trunk revision 122.

You want all three changes on the MayBranch–123, 124, and 125–to be merged into your AugustBranch. If you select all three revisions, or leave the revision specifier empty, this will happen. The merge will use revision 122 on trunk as the BASE, with 125 on MayBranch as source revision, and 127 on AugustBranch as destination revision.

If instead you select HEAD as the revision to merge, SVN will use revision 124 on MayBranch as the BASE, with 125 as the source revision and 127 as destination as before. Since BASE is now the place where revision 125's changes were started from, you only get the changes that specifically happened in revision 125.

The final result is as if you had exported only revision 125 on MayBranch as a diff, and then applied that diff to the AugustBranch. Except this is done with merge tracking information included so that SVN knows how to get the whole branch automatically later if you like.

4
  • Sorry i could not understand, why previous version is not up to date with HEAD version. While people check in the HEAD version file, they will use the previous file and update their changes and check in the file. Why HEAD will not be the latest version.? Are you telling about the subfolders.. Can you please explain me?
    – Manoj
    Mar 2, 2014 at 15:11
  • I edited the answer to add an example, as it is too long to add as a comment.
    – Ben
    Mar 2, 2014 at 15:48
  • What exactly does it mean to merge a revision? What is the information provided in such a changeset and how is this information applied within the merge? Does the changeset just say add these five lines at line 16? I mean that can lead to terribly wrong results. Or does it search for the spot where to put those lines and if so, how does that work?
    – Ini
    May 29, 2019 at 18:10
  • All of the above. I don't know the details. It does seem to take line numbers into account so that if you have similar code in multiple locations in the file it will usually pick the correct spot, however the main driver seems to be matching up unchanged lines surrounding the changes. It usually does the right thing, but yes it can give terribly wrong results occasionally, so you should always check your merge results are as expected before you commit a merge.
    – Ben
    May 29, 2019 at 19:35
1

If you want to merge all changes since last merge, let "Revison range to merge" empty:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.