简体   繁体   中英

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM