0

Im trying to merge with SVNKit but it cause tree conflicts. To find the reason I did some experiments with the svn command line tools. This command will cause the same conflicts as for SVNKit:

svn merge –r 0:HEAD "https://svnserver.com/svn/test/trunk"

But

svn merge "https://svnserver.com/svn/test/trunk"

is working fine.

So how can I do the same with SVNKit? doMerge requires a SVNRevisionRange.

SVNRevisionRange r = new SVNRevisionRange(SVNRevision.create(0), SVNRevision.HEAD);
dc.doMerge(mergeUrl, mergeRev, Arrays.asList(r), mr, INFINITY, true, false, false, false);
Noetzold
  • 1
  • 1
  • 1
    Probably completely off-topic hint, but: if you are using Linux as development platform; consider using "git svn". Basically that allows you to run your "local" repository ... as git; using your existing SVN server as "remote". All of a sudden, most of the SVN pain goes away; and you get all the sophisticated features of git (for example its merging capabilities; or cherry picking) for almost free (almost as in: you need some time to learn git, but I think it is very much worth the price - releasing code is so much better since I started using git/svn). – GhostCat Mar 03 '16 at 09:47
  • Thank you for the reply but I’m using Windows as a development platform because of the required toolchain. I like to switch to git but I need to restrict access to some fodders. – Noetzold Mar 03 '16 at 10:03
  • @Jägermeister how does this relate to the question? – bahrep Mar 03 '16 at 10:07
  • @bahrep It does relate to the question in the sense that there are sometimes options "outside" the original context that might resolve the problem; just in a very different way than the original question implies. Why do you think I put down my suggestion is a "off-topic" comment? – GhostCat Mar 03 '16 at 10:10
  • @Jägermeister because this is offtopic in context of the current question. – bahrep Mar 03 '16 at 10:13
  • @bahrep So is the discussion that we have now. Thing is: I have seen more than one person whom I told about git/svn ... telling me later on, that moving from svn to git/svn solved a myriad of problems for them. – GhostCat Mar 03 '16 at 10:16
  • @Jägermeister again, this **is** offtopic. Thank you for sharing your precious experience, though. :) – bahrep Mar 03 '16 at 10:22

1 Answers1

1

First of all, you don't ever need to run merge for all revisions in repository like you do in the first example. Tree conflicts occur because there were folder renames in those 0:HEAD revisions and they can't be applied cleanly as is. Read SVNBook | Dealing with Structural Conflicts.

Regarding your SVNKit code snippet, it seems that you want to run reintegrate merge (do you?). In such case, you are doing it wrong. Read SVNKit SvnMerge class documentation on reintegrate merges.

I guess that your Subversion svn.exe client has version 1.8 or newer. Beginning with version 1.8, the client does reintegrate merges automatically and it seems to me it did automatic reintegrate merge when you ran svn merge "https://svnserver.com/svn/test/trunk".

bahrep
  • 29,961
  • 12
  • 103
  • 150