Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svn merge with --reintegrate complains about missing ranges but mergeinfo seems correct

Tags:

svn

svn-merge

I have a project with with the following structure

^/project/trunk
^/project/branches/mybranch

where current HEAD is revision 1048. The branch was copied from trunk in r523. trunk has been merged to mybranch with the result being r1048. The mergeinfo on ^/project/branches/mybranch gives

/project/trunk:523-1047

and the mergeinfo of trunk has no record mentioning anything from ^/project/branches/mybranch. Actually in reality both trunk and branches also hold mergeinfos from branches parallel to mybranch but those mergeinfos appear as absolutely identical in both outputs.

Now I go into my working copy of trunk and try to issue

svn merge --reintegrate ^/project/branches/myproject

I get an error message that says:

svn: Reintegrate can only be used if revisions 523 through 1048 were previously merged from file:///home/svn/project/trunk to the reintegrate source, but this is not the case:
  project/branches/mybranch/src
    Missing ranges: /project/trunk/src:523-1047

That is weird because the mergeinfo on my branch folder tells me that 523-1047 have been correctly merged from trunk to branch. What is the deal with that subfolder? src is a directory that obviously exists in both trunk and branch.

I think that is where something is fishy. If I look into the mergeinfo of mybranch/src via svn pg svn:mergeinfo ^/project/branches/mybranch/src@HEAD I get nothing at all. If I look at the trunk/src however (svn pg svn:mergeinfo ^/project/trunk/src@HEAD) I get

/project/branches/mybranch/src:784

So it seems as though someone did a cherry-pick from branch to trunk there. However this does not appear in the trunk folder itself.

Is that where the trouble lies? And most importantly: how can I cure it??

like image 585
janitor048 Avatar asked Feb 20 '13 17:02

janitor048


2 Answers

Is that where the trouble lies?

Yes, exactly - merge subtree later always confuse reintegration

And most importantly: how can I cure it??

Remove mergeinfo from /project/trunk/src

like image 103
Lazy Badger Avatar answered Sep 28 '22 07:09

Lazy Badger


Here is a very similar topic you might want to have a look at:

Reintegrate can only be used if revisions were previously merged URL to reintegrate the source

Especially this answer from Paul Whipp has helped me a lot when I encountered the same problem and didn't want to delete the mergeinfo, because this somehow sounded like a workaround and not a "real" fix.

In short: Try to merge the missing information manually for that specific file/ folder (just as svn suggests). Worked like a charm for me.

See Pauls answer for the corresponding code excamples, etc.

like image 25
Max Graser Avatar answered Sep 28 '22 07:09

Max Graser