Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN Reintegrate same branch to trunk multiple times

The SVN book states the following:

Once you have performed a reintegrate merge you should not continue to use it for development. The reason for this is that if you try to resynchronize your existing branch from trunk later on, merge tracking will see your reintegration as a trunk change that has not yet been merged into the branch, and will try to merge the branch-to-trunk merge back into the branch! The solution to this is simply to create a new branch from trunk to continue the next phase of your development.

In my case I want to keep using the branch after the reintegration to trunk and continue reintegrating to trunk multiple times. I have done this and I have run into two main problems:

  1. I keep getting weird tree conflicts when I try reintegrate.
  2. I keep getting a message that says something like "Reintegrate can only be used if revisions 280 through 325 were previously"

How do I get around this issue if I want to be able to reintegrate from a branch multiple times?

like image 592
General_9 Avatar asked Apr 15 '12 13:04

General_9


People also ask

What is SVN reintegrate?

In the svn book it says merge 's --reintegrate is "to merge all of the source URL's changes into the working copy".

What is cherry pick in SVN?

A cherry-pick merge is used to merge specific revisions (or revision ranges) from one branch to another. By default, this uses merge tracking to automatically skip any revisions that have already been merged to the target; you can use the --ignore-ancestry option to disable such skipping. SOURCE is usually a URL.

How do I merge revisions in SVN?

Have a local checkout of the branch to which you want to merge a range of revisions from a source branch. By default, "Merge a range of revisions" is clicked. Click Test Merge to check if it merges desired revisions/files.


2 Answers

You can use the --record-only merge option as explained in SVN book, section Keeping a Reintegrated Branch Alive

Note that from Subversion 1.8, this is no longer needed, as automatic reintegration merge was introduced.

like image 199
rlovtang Avatar answered Sep 21 '22 22:09

rlovtang


I've seen a number of workarounds on Google but they made me nervous as 'hacks'. To address it I decided to do just what subversion is hinting at in the message. I went back to my branch and explicitly merged the specified revisions:

~/python/orb $ svn merge -r 650:693 https://paulwhippconsulting.slsapp.com/source/orb/trunk
~/python/orb $ svn commit -m 'merged revisions 650:693 from trunk'
Sending        occl

Committed revision 695.

Once I did this, I was able to return to the working copy of trunk and reintegrate the branch without any problems.

I hope this helps

like image 42
Paul Whipp Avatar answered Sep 20 '22 22:09

Paul Whipp