tags:

views:

151

answers:

2

I have done a lot of development on a branch in my subversion repository. Throughout this I've merged in the trunk changes by manually tracking which ones I put in. I accidentally read an SVN 1.0 book which explicitly told me that SVN doesn't track which changes have been merged, so I tried to specify which ones to merge into my branch to keep it in sync with the trunk and all the development that was going on there.

The problem lies here: I missed a lot of changes when syncing. I synced it to what I thought was up to date a few days ago, and then to get it back into the trunk I tagged and deleted the current trunk, and then copied my branch into the trunk. However, some of the development that was done on the trunk (in fact quite a bit of it) has been lost because I didn't apply those changes before moving my branch into the trunk and didn't svn merge --reintegrate (which would have applied my changes to the trunk). Development has been done on this new trunk since then (a whole whack of bugfixes) so I can't really redo the merge.

Important: I am actually using SVN 1.5, which uses the svn:mergeinfo property. This is great because I know exactly what revisions I missed, however I can't get SVN to apply them. I tried doing this on my working copy (a checkout of the trunk):

svn merge http://example.org/svn/trunk

to no avail, and this also:

svn merge --ignore-ancestry http://example.org/svn/trunk

which seemed to apply way too many changes, I think it was apply every changeset ever made instead of just the ones I missed when updating my branch.

Please help!

+1  A: 

you can specify a revision range to merge using svn. So you can specify each revision you missed to get just those changes that were made each time.

eg.

svn merge -r 30:31 thhgttg.txt

After you've updated all the revisions, I would edit the mergeinfo property so it holds the full set of revisions.

gbjbaanb
+1  A: 

I tagged and deleted the current trunk, and then copied my branch into the trunk

Never do that. The URL http://example.org/svn/trunk now references different versioned objects depending on the revision you are talking about: the old trunk, or the new trunk. To distinguish between both you can use a peg revision like this:

svn merge http://example.org/svn/trunk@X

If the peg revision X is a revision from before you deleted trunk (for example, the revision which deleted the trunk minus one) then this will merge all eligible revisions from the old trunk.

You can use the --dry-run option to see what would happen without actually doing anything. You can use -r or -c to specify specific revisions or ranges to merge, as explained when you type svn help merge.

Wim Coenen