views:

72

answers:

4

I need to move svn folder to one level up and keep all history

All files and directories from h_t_t_p_s://myserver.com/svn/Project/trunk/ into h_t_t_p_s://myserver/svn/Project/

I use a command:

svn move h_t_t_p_s://myserver.com/svn/Project/trunk/ h_t_t_p_s://myserver/svn/Project/

but it says:

svn: Cannot move path 'h_t_t_p_s://myserver.com/svn/Project/trunk/' into itself (h_t_t_p_s - should be https)

Who know how can I resolve that problem? Thanks!

+1  A: 

I don;t know if you can move it that way, personally I would checkout repository, move folder in filesystem and then commit changes, deleting it at one location and adding at another.

Tomasz Kowalczyk
you will not keep the history, after that you will have only last revision
ihorko
why? you'll have all changes, but in new tree.
Tomasz Kowalczyk
as i thought of the problem a little bit i found another solution - dump repository at a specified tree, let's say:svnadmin dump repo/path/other/inner > file.dumpthen delete dir "inner" -> it will remove it from repository, and now load it at another path:svnadmin load /repo/ --parent-dir /path < file.dumpthat way you'll have all directory tree committed and history saved
Tomasz Kowalczyk
+1  A: 

Try:

svn switch --relocate https://myserver.com/svn/Project/trunk/ https://myserver/svn/Project/

Please test this in a seperate repository before you run it on your real one!

Nix
Thanks, I tried, but svn says: svn: '.' is not a working copy
ihorko
You ran the command from the base directory of the project on your file system?
Nix
A: 

I don't believe you can move directly to existing directory (especially repository root). Maybe --force option could help.

If it's possible to checkout whole repo you could move every directory from trunk to upper level, it seems like more reliable solution

svn mv * ..

* is not supported by some svn clients

Dmitry Yudakov
A: 

If you are willing to use TortoiseSVN then you can simply move the folder with the repository browser. That is how I usually move folders around, very simple and painless.

Stefan Egli
Yes, I use TortoiseSVN, it's really very simple in repository browser, Thank you so much for your help!!!
ihorko