parrker9
parrker9

Reputation: 958

SVN re-checkout (switch/relocate/something else?)

The project that I am currently working on at the moment uses SVN for version control. When it was initially created (by another person who is not currently available), the 'public_html' folder on the server was checked out to the following folder: https://URL/project_name/ with 'project_name' being the root of the repository. It did not provide any structure for branches/tags because apparently it didn't look like we would ever need it.

Now that we realise that we need the branches to organise parallel work on several versions of the project, we decided to create a new repository with proper structure ( URL/project_name/trunk/ for the main version and URL/project_name/branches/... for secondary ones). There is no problem with organising the repository itself, but how do I do a new checkout for the 'public_html' folder on the server? If I try to do 'svn checkout URL/project_name/trunk /home/public_html', I get the error message saying that 'public_html' is already a working copy for a different URL.

I tried to look at the svn switch and svn relocate options on a local test machine through Tortoise SVN, but the former only seems to work for switching among branches of the same repository, and the latter requires to specify the root of the repository (and I need to specify the URL/project_name/trunk as checkout folder). Could anyone help or at least direct me in this situation?

I do have a root SSH access to the server.

Upvotes: 0

Views: 3446

Answers (4)

EKI
EKI

Reputation: 856

Can't you use a GUI to SVN like TortoiseSVN??? I think that relocating stuff in the repo was as easy as dragging with the right click and selecting the appropriate option and then commit.

Also you can try to do it within the repo-browser. http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-dug-rename.html

Upvotes: 0

Esepakuto
Esepakuto

Reputation: 1332

If project_name is your root folder you can create the branches/tags/trunk structure under it and do a manually svn move for each file/folder contained in project_name (except branches/tags/trunk of course). So you can preserve all the history of your commits. It's tedious, but safe!

Upvotes: 1

JB Nizet
JB Nizet

Reputation: 692071

From TortoiseSVN Help:

Put another way, you need to relocate when your working copy is referring to the same location in the same repository, but the repository itself has moved.

It does not apply if:

You want to move to a different Subversion repository. In that case you should perform a clean checkout from the new repository location.

You want to switch to a different branch or directory within the same repository. To do that you should use TortoiseSVN → Switch.... Read Section 4.19.2, “To Checkout or to Switch...” for more information.

So, what you must do is checkout a new fresh copy. Either Delete the whole content of your directory and then checkout, or Checkout to a new directory, and then rename the new one with the name of the old one.

Upvotes: 2

vaugham
vaugham

Reputation: 1851

Try to svn move your project_name to your trunk. Do not alter directly your file system ; it will have no effect on your repo files. Use svn commands instead.

// in URL (parent folder of project_name)
svn mkdir trunk
svn mkdir branches
svn mkdir tags
svn move project_name trunk 
svn ci -m 'moved'

et voilà

if you don't have a parent folder, you will have to "svn move" every file and directory in the project_name root one by one.

Upvotes: 2

Related Questions