tags:

views:

861

answers:

3

I have a project in subversion, called inboundem. It was my first, and when I created it, I omitted trunk. I need to get it into the correct structure as inboundem/trunk. I had another project like this, but as there were no revisions, I did svn delete and then svn import and that worked well. But I have a lot of revisions with inboundem and I do not want to lose the history.

I cannot do svn move, as svn will not let me move a project into itself.

I suspect that I need to go down the svnadmin dump/load path, so I have done:

svnadmin dump /subversion/active | svndumpfilter include inboundem > inboundem.dump

and that has created a dump file with all my history for inboundem. But what do I do now?

I suspect that I should do svn delete and erase the project, then manually edit the dump file and change Node-path everywhere from inboundem to inboundem/trunk, and then do

svnadmin load /subversion/active < inboundem.dump

Is this safe? Is there an easier way? Maybe I should just brute force it, and check out all the revisions one by one, delete the project and then recreate the project revision by revision.

+1  A: 

Why not just create a folder in the project root named "trunk" and then move all the files/folder in root into that folder?

I have done this before in Tortoise, I am not sure what underlaying command it uses because you are saying svn move won't work for you. Maybe try copy and then delete?

James McMahon
Because it would copy the .svn folders and seriously screw with SVN
Malfist
Ah, surely there is a way to tell the command line client to ignore .svn. I don't know what OS you are using, but Tortoise will let you do a simple drag and drop in the repository viewer to complete this task.
James McMahon
Move the folders with a right drag (if you're using TortoiseSVN). When you release the mouse button after a right-drag, choose "SVN move items to here" which will do an 'svn mv' instead of an explorer only move.
Stefan
Oh, thats a nice trick Stefan. I usually just do this through the repo-browse feature.
James McMahon
A: 

You can use svn export and then move the exported source into /trunk and then commit the changes (adding your new folders in /trunk)

And then delete (and call delete) on the old folders, there will still be a history of them for you to restore to if you have to, but it will restore them to the old folder, not the new trunk. All svn export does is move the chosen directory(s) to a new location without the .svn folder so it acts as if it's not a working copy, and from there you can add it to your working copy.

Malfist
+6  A: 
svn mv svn://repo/inboundem svn://repo/trunk
svn mkdir svn://repo/inboundem
svn mv svn://repo/trunk svn://repo/inboundem/trunk
bendin
This is more simple than my solution.
Malfist
And it works. Thanks.
codebunny
And it preserves the history.
gbarry
Yea. I've had to do it more than once myself.
bendin