Per this old question, using SVN 1.5, reintegrating a branch multiple times is problematic, and should be avoided.
There has been some rumbling to the effect that, "This is a known issue, and should be fixed in SVN 1.6." Was that the case? Is it fixed? Can I reintegrate multiple times?
How Subversion Branching Works 1 Create a branch using the svn copy command. 2 Use svn checkout to check out a new working copy. 3 Use a sync merge to keep your branch up-to-date as you work. 4 Use svn merge to send your changes back to the trunk. More ...
One of them is related to reintegrating a branch into the trunk. Assuming that one is working with the trunk as a working copy and want to reintegrate the branch called feature, the reintegrate command is simply: svn merge --reintegrate url://path/to/branches/feature .
Here's a basic step-by-step overview of SVN branching and merging. Create a branch using the svn copy command. Use svn checkout to check out a new working copy. Use a sync merge to keep your branch up-to-date as you work. Use svn merge to send your changes back to the trunk. Many teams have switched from SVN to Helix Core.
Before you reintegrate, ensure the two branches you will be using are in a clean state (have no uncommitted changes.) In command line enter the directory of the branch that you want to reintegrate your work in to (usually trunk) and run svn update. Now you can reintegrate your working branch by running:
To merge a branch topic into the trunk repeatedly: Do the following on every merge.
svn merge --reintegrate <topic> <trunk>
, as you would normally. (=> r
M
)svn merge --record-only -c M ^/<trunk> <topic>
. Note the record-only
option. Step 2 essentially tells the topic branch to consider the merge commit (revision M
, from step 1) part of its history. This merge-revision is the one that usually causes problems during reintegration; svn tries to undo rM when integrating topic a second time.
So, repeated reintegration works, just not automatically. :)
I eventually found this solution through an enlightening commit message to the svn source and the matching test (search for "def multiple_reintegrates"). This is a "clever trick" discovered and used by svn-devs with the current releases. It's even been added to more recent documentation. The result is still not as good as a DVCS's merging properties, but it's at least functional.
The only broad downside (as per an open issue as of June 2, 2010) is that apparently the svn log -g
output is messy. I guess this is the risk.
Yes, you can. The problem you ask about was solved in Subversion 1.8.
Beginning with SVN 1.8, --reintegrate
option is deprecated and reintegrate merges are now performed automatically (or automagically :) ). See Subversion 1.8 Release Notes and read updated SVNBook 1.8 | Reintegrating a branch chapter:
If you choose not to delete your branch after reintegrating it to the trunk you may continue to perform sync merges from the trunk and then reintegrate the branch again. If you do this, only the changes made on your branch after the first reintegrate are merged to the trunk.
...
Only Subversion 1.8 supports this reuse of a feature branch. Earlier versions require some special handling before a feature branch can be reintegrated more than once. See the earlier version of this chapter for more information: http://svnbook.red-bean.com/en/1.7/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.reintegrate
IMPORTANT: You should upgrade your Subversion client and server if you still use Subversion 1.7 or older. The current and best version of SVN is 1.9 as of year 2016. There is no real reason to be using very old Subversion releases such as 1.5, 1.6 or even 1.7. There were numerous improvements on client and server side since version 1.6!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With