Reintegrate can only be used if revisions X through Y were previously merged from to reintegrate the source, but this is not the case

后端 未结 11 1816
野的像风
野的像风 2020-12-04 05:54

Been using SVN branches with Tortoise 1.6. I\'ve been periodically merging the trunk into the branch to keep it up to date.

Today, I thought I\'d reintegrate the br

相关标签:
11条回答
  • 2020-12-04 06:31

    Just do as SVN is telling you.

    1. Merge the branch from the Reversion that SVN is telling you
    2. Reintegrate from Branch to trunk
    0 讨论(0)
  • 2020-12-04 06:38

    If you try to reintegrate your branch to trunk and you see errors like this from TortoiseSVN:

    Merge reintegrate test only failed!: "Reintegrate can only be used if some revisions were previously merged from trunk, but this is not the case"

    Click on the error text and press CTRL + A, CTRL + C to copy all the text.

    Paste the text into the here-string of this PowerShell script:

    @"
    Command: Reintegrate merge http://svn.cloudcorp.com/branches/myproject into C:\Users\iain\Documents\Repositories\CloudCorp\trunk  
    Error: Reintegrate can only be used if revisions 18089 through 18612 were previously  
    Error:  merged from http://svn.corp.skyscanner.local/svn/SkyScannerDatabase/trunk to  
    Error:  the reintegrate source, but this is not the case:  
    Error:    
    Error:  branches/myproject/userdata/usermanagementservice  
    Error:   
    Error:     Missing ranges:  
    Error:  /trunk/userdata/usermanagementservice:18365,18404  
    Error:    
    Error:  branches/myproject/userdata/auto_create_db.sql  
    Error:   
    Error:     Missing ranges:  
    Error:  /trunk/userdata/auto_create_db.sql:18406  
    Error:   
    Error:    
    Error:  branches/myproject/userdata/create_audit_tables_triggers_uds.sql  
    Error:   
    Error:     Missing ranges:  
    Error:  /trunk/userdata/create_audit_tables_triggers_uds.sql:18406  
    "@ -split "`n" |
    ? { $_ -match ('Error: +branches') } |
    % { $_.Substring($_.IndexOf('userdata')) } |
    % { "svn propdel svn:mergeinfo $_" }
    

    The script extracts the relative paths of files with problem mergeinfo and outputs a list of commands to fix each one.

    You may have to change the 'userdata' value to suit your repository structure.

    Execute the script to output the commands you need to remove the problem mergeinfos.

    In this example, the script would produce this output:

    svn propdel svn:mergeinfo userdata/usermanagementservice  
    svn propdel svn:mergeinfo userdata/auto_create_db.sql  
    svn propdel svn:mergeinfo userdata/create_audit_tables_triggers_uds.sql  
    

    At the command prompt you can navigate to the branch base (myproject) and execute the commands to delete the problem mergeinfos.

    You should see output like this:

    property 'svn:mergeinfo' deleted from 'userdata\usermanagementservice'.
    property 'svn:mergeinfo' deleted from 'userdata\auto_create_db.sql'.
    property 'svn:mergeinfo' deleted from 'userdata\create_audit_tables_triggers_uds.sql'.
    

    As in Gray's answer, now you should commit the changes to the branch and try to reintegrate again. This time it should work!

    0 讨论(0)
  • 2020-12-04 06:41

    Got this issue on

    • TortoiseSVN 1.9.7, Build 27907 - 64 Bit , 2017/08/08 19:34:38
    • Subversion 1.9.7, -release
    • apr 1.5.2
    • apr-util 1.5.4
    • serf 1.3.9
    • OpenSSL 1.0.2l 25 May 2017
    • zlib 1.2.8
    • SQLite 3.14.1

    right click on the branch where you wish to merge (but getting this message) and select the option "update to revision" and then on the dialog which opens (screenshot below) select those revisions and click ok - once all previous revisions are merged, you wouldn't get this message

    Adding this here to help someone who is using Tortoise SVN

    0 讨论(0)
  • 2020-12-04 06:44

    See also my answer here for my experience with a similar case. I'm not sure if this is the source of your problem, but it does look like Subversion 1.8 has problems with the mergeinfo when two changes cancel each other.

    0 讨论(0)
  • 2020-12-04 06:44

    I got this error after using a partial checkout of a branch. I was keeping the branch up to date with the trunk but the trunk revisions for parts of the branch that were not checked out were of course not being updated. The fix was to do a full checkout of the branch and then merge in all of the trunk changes. After committing these to the branch I could merge the branch to the trunk successfully.

    0 讨论(0)
  • 2020-12-04 06:46

    I ran into this issue. I did an SVN log on my branch to find were I had merged trunk to my branch.

    I noted all the revisions.

    I then did the merge of my branch to trunk by specifying the revisions manually. I specified all ranges to exclude the revisions were I merged trunk. I manage to get my branch merged.

    I had to do some reverts on mergeinfo, but I got my code merged.

    I immediately deleted my branch.

    0 讨论(0)
提交回复
热议问题