SVN merge reintegrate missing ranges but nothing to merge
Asked Answered
M

2

8

Here is the riddle:

C:\code\trunk> svn merge --reintegrate http://svn.e.com/repos/branches/lih --accept postpone --dry-run
svn: E195016: Reintegrate can only be used if revisions 11430 through 12384 were previously merged from http://svn.e.com/repos/trunk to the reintegrate source, but this is not the case:
  branches/lih
    Missing ranges: /trunk:11902

But then if I go into the branch's directory and try to merge that range, there is nothing to merge!

C:\code\branches\branch> svn merge -r 11901:11902 http://svn.e.com/repos/trunk --accept postpone --dry-run
C:\code\branches\branch>

Even svn merge -r 11898:11903 shows nothing to merge.

Now I seem unable to reintegrate my branch into trunk! Please help!

P.S. The lih branch wasn't created until 11906. It was branched from the hd branch, which was branched from trunk (and hd has already been merged back into trunk).

Melvamelvena answered 24/10, 2012 at 19:9 Comment(0)
M
3

This seemed to work for me, but I can't claim to understand it or vouch that it's the best way to resolve my problem.

First, it's important that your branch has all the latest commits to trunk. So sync it up (do a merge from trunk to branch).

Then you can essentially force a reintegrate by doing this in the trunk directory: svn merge http://svn.e.com/repos/trunk/@REV http://svn.e.com/repos/branches/lih/ . --dry-run (but replace REV with the latest revision #).

Melvamelvena answered 25/10, 2012 at 21:25 Comment(1)
This really helped me, but instead of REV being the latest version of the trunk I had to set it to the version the branch was created. This to avoid the merge reverting modifications that occurred in the trunk during development in branch.Oxygenate
P
5

I just ran into something similar, where the issue was that trunk had had two cancelling revisions (i.e., rev 20865 on trunk undid rev 20857). So when I first merged from trunk to branch, it didn't have anything to merge for this pair of revisions, but didn't include them in the mergeinfo for the files in question. Then when I tried to merge back from branch to trunk, it objected that these two revisions were missing.

My solution (after manually verifying that the revisions cancelled for the files in question) was to merge each of the two revisions to branch explicitly (via svn merge ^/trunk -c 20857, and svn merge ^/trunk -c 20865), commit, and then merge the branch back to trunk. The second time, it went smoothly. This was with Subversion 1.8.0 (r1490375).

I was able to get around a similar problem earlier using merge with --record-only to mark the changes as properly merged on the branch, but it's probably safer to merge the actual files (just in case there's a change that doesn't quite cancel).

Looks like a bug in the way Subversion 1.8 handles mergeinfo for cancelling changes to me.

Potbelly answered 26/11, 2013 at 23:24 Comment(0)
M
3

This seemed to work for me, but I can't claim to understand it or vouch that it's the best way to resolve my problem.

First, it's important that your branch has all the latest commits to trunk. So sync it up (do a merge from trunk to branch).

Then you can essentially force a reintegrate by doing this in the trunk directory: svn merge http://svn.e.com/repos/trunk/@REV http://svn.e.com/repos/branches/lih/ . --dry-run (but replace REV with the latest revision #).

Melvamelvena answered 25/10, 2012 at 21:25 Comment(1)
This really helped me, but instead of REV being the latest version of the trunk I had to set it to the version the branch was created. This to avoid the merge reverting modifications that occurred in the trunk during development in branch.Oxygenate

© 2022 - 2024 — McMap. All rights reserved.