views:

715

answers:

4

I'm trying to reintegrate a development branch into the trunk in my Subversion 1.5 repository. I merged all the changes from the trunk to the development branch prior to this operation. Now when I try to reintegrate the changes from the branch I get the following error message:

Command: Reintegrate merge https://dev/svn/branches/devel into C:\trunk  
Error: Reintegrate can only be used if revisions 280 through 325 were previously   
Error: merged from https://dev/svn/trunk to the reintegrate   
Error: source, but this is not the case:  
Error:   branches/devel/images/test  
Error:     Missing ranges: /trunk/images/test:280-324  
...

The message then goes on complaining about some folders in my project. But when I try to merge the changes from the trunk to the development branch again, TortoiseSVN tells me that there's nothing to merge (as I already merged all the changes before):

Command: Merging revisions 1-HEAD of https://dev/svn/trunk into C:\devel, respecting ancestry  
Completed: C:\devel  

I'm trying to follow the instructions from here: http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html, but there's nothing about solving such a problem.

Any ideas? Perhaps I should just delete the trunk and then make a copy of my branch? But I'm not really sure if it's safe.

A: 

Juste a wild guess, but you did commit your merge on your branch ?

Axelle Ziegler
Sure, I did a commit of all changes after doing the merge from the trunk.
pako
+1  A: 

These links are good descriptions of reintegrating and might help:

Subversion merge reintegrate
Subversion 1.5 merge-tracking in a nutshell

Michael Hackner
After looking at "Subversion merge reintegrate", I tried doing a merge from the branch to the trunk (instead of reintegrating the changes), but I saw a lot of weird conflicts, including tree conflicts.
pako
+1  A: 

You have to merge the revisions r280 to r324 from trunk into your branch first.

It seems you already merged r325 into your branch, however --reintegrate needs to get all revisions up to your latest revision merged. There must be no gap. So here a little Diag:

           +----------------------> /branches/devel
          /                    /   \<--merge not working!
 --------/-------+--+---+-----+---------> trunk
         |       \  |  /      |
        280       \ V /      325
                    V
                  missing sync merges from trunk to branch

I think this is your branch structure, so you need to sync all changes from trunk to your branch. You only merged r325, so just merge r280-r324 and after doing this you should be fine to use --reintegrate

Peter Parker
Unfortunately, this is not the case. When I try to merge the specific range of revisions (280 through 325) from the trunk do the devel branch, TortoiseSVN says that there's nothing to merge (I merged these changes before and of course commited the merge). But when I try to reintegrate, I get the error message.
pako
A: 

I stopped getting these problems when I started using the -r option to svn merge command and did not attempt to do the --reintegrate until after I had merged without it. I'm using svn 1.6.1.

Here's what I do:
1. when merging from branch to trunk or trunk to branch, I use the -r option like this:

 cd branchWorkArea/topDir
 svn merge -r<branchPoint>:HEAD [otheroptions] svn://svn/project/trunk/topDir
  1. when I have resolved any conflicts and test my code, I commit the merge to the branch and then merge the branch to the trunk using the same basic options (especially -rBranchPoint:HEAD)

  2. when the trunk has been tested and committed, then I use the --reintegrate option to the close off the branch. Make sure you use the -rbranchPoint:HEAD option on it too.

For other options, I always use

--depth infinity (defaults to infinity in 1.6.2 but not before)
-x -b -x -w --ignore-eol-style

Maybe, I've just been lucky but things sure seem to work better.

To find the branch point for a branch, you do a svn log --stop-on-copy then look at the to very last revsion -- it will be the svn copy that created the branch.

To do this on linux, I do something like this:

svn log --stop-on-copy svn://svn/project/trunk/topDir |
grep '^r' | tail -1 | sed -e 's/^r//1'-e 's/ .*//g'

this should print the revision number of the branch point.

Good luck

Lowell Boggs