Tuesday, 9 February 2010

Unable to merge or create branches with SVN

I've been using SubVersion for a while, several years infact, I use VisualSVN on my server and TortoiseSVN on my machines.



Until recently I had never experienced any problems or glitches with it. However at some point within the last two months one of my main repositories started playing up. It's the only repository I have ever branched. The problem occurred when after working on a branch for several months I decided it was time to merge it back into the head. However when I tried to use the merge function and take the branch into the head I was given the following error message:

[branch] is not a child of repository root URL [trunk]




I tried several attempts at trying to do this, rechecking out the branch and trunk in case they were corrupt but to no avail. I then decided to try creating a new branch to see if the repository was totally broken and I indeed got an error.


Repository moved permanently to [svn server address] please relocate;




So it looked liked the reopsitory was broken. On a bit of a whim I noticed that my file path looked something similar to f:\development\shared\a repository name\trunk and similarly the branch was f:\development\shared\a repository name\1.6 The SVN url however was http://[svn-url]/svn/arepositoryname , I was wondering if somehow the directory path was confusing SVN, was it always expecting the directories to be checked out in the same folder structure as the server.




So I tried creating a new directory called arepositoryname and then checked out the trunk and version 1.6 underneath it. I then tried to merge the 1.6 repository back into the trunk and create a new branch and it all worked fine!




So it indeed seemed that TortoiseSVN was getting confused by my folder structure not replicating the servers, simply fixing this, maybe it was just removing the spaces need to possibly try that further, resolved my issue.




Just to add clarification if you stumble across this trying to solve your issue that I was running VisualSVN 2.1 and Tortoise 1.6 on a Windows 7 x64 machine.




Some crazy behaviour but I least I figured it out after several hours ... hope this helps.

3 comments:

  1. You just saved me hours of work! Thanks a bunch for taking the time to post your findings. It was certainly an odd one.

    ReplyDelete
  2. Hi MJJames, I seem to be having a similar problem. I'm wondering if you could clarify exactly how you fixed this.

    I have a project set up in eclipse as projectname and I've checked out the trunk to the top level of the project so the trunk is at https://[repos-site]/svn/repos-name/trunk so the project name shows up in subclipse as projectname [repos-name/trunk]. When I try to merge I get the error https://[repos-site]/svn/repos-name/branches/v2 is not a child of repository root URL https://[repos-site]/svn/repos-name/trunk . How is this possible?

    Also, on creation of my branch I got the other error Repository moved permanently to https://[repos-site] please relocate;

    Can you be specific on the directory structure on your solution? Any help would be greatly appreciated. I'm pulling my hair out! : \

    ReplyDelete
  3. Also, just to mention, I can merge the trunk to the branch just fine, but I cannot merge the branch into the trunk.

    ReplyDelete