Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subversive: svn: E195016: Cannot merge into a working copy with a switched subtree

I have an issue with Eclipse and Subversive.

I'm trying to reintegrate a branch of a project into the trunk.

These are the operations that I'm following:

  1. Switch to the trunk version of the project
  2. I have ensured that there were no any pending operations, doing a Revert and an Update, in order to start from a "clean" working copy, perfectly synchronized with the remote copy of the trunk
  3. I go to "Team -> Merge ..."
  4. I go to the "Reintegrate" tab, and I choose the branch that I want to merge within the trunk, pointing at "Head revision" of the branch.
  5. I press the OK button, but this is the error that I obtain:

 Merge operation failed.
Can't overwrite cause with org.tmatesoft.svn.core.SVNException: svn: E195016:
Cannot merge into a working copy with a switched subtree

I don't understand what's wrong.

I'm using this Eclipse and SVN configuration:

Eclipse Java EE IDE for Web Developers.
Version: Neon.1 Release (4.6.1)
Build id: 20160913-0900

Subversive SVN Team Provider    4.0.3.I20161129-1700    

SVNKit 1.8.14 Implementation (Optional) 6.0.3.I20161124-1700

SVN 1.9

Thanks in advance.

like image 556
Alessandro C Avatar asked Dec 13 '16 17:12

Alessandro C


2 Answers

I don't know exactly why there is this issue, but I noticed that it occurs if we perform some "switch" operations between branches before the Merge operation.

For some reasons, in this situation it's avoided to perform a merge operation.

The "workaround" that I have found is to perform the merge operation on a clean copy of the trunk, after the SVN checkout of the trunk, without make any switch operation.

In this way, the error doesn't occurs any more.

It's not a practical solution, but it works.

like image 156
Alessandro C Avatar answered Sep 22 '22 06:09

Alessandro C


Reintegration merges in SVN 1.8 and newer are done automatically, by default. Automatic reintegration merge cannot be performed in case your working copy is of mixed revision or has switched paths.

SVNKit might be working differently from actual Apache Subversion, though.

Read about automatic merges in SVNBook:

Your trunk working copy cannot have any local edits, switched paths, or contain a mixture of revisions (see the section called “Mixed-revision working copies”). While these are typically best practices for merging anyway, they are required for automatic reintegrate merges.

like image 29
bahrep Avatar answered Sep 23 '22 06:09

bahrep