Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

subversion: getting rid of versioned ".svn" directory

Tags:

svn

I don't know exactly how it happened, but I have a versioned ".svn" directory in my repository. Don't ask me how it got there. If I tell svn to delete it, it does not want to, since .svn is a reserved argument.

Force does not work.

Any ideas?

EDIT: Ok I solved it by svn rm ing the parent directory and adding it back in.

Still, If someone knows the clean solution to this, it would be highly appreciated.

CLARIFICATION:

svn delete <repo url>/foo/.svn

Does not work. I think I tried every simple combination of commands and arguments. I am pretty sure, that if that is doable, it is a hack. I know of the method: dump -> modify dump with tool -> reimport but that is as scary as hell. This is not git, if you whack an svn repo, you/it stays whacked.

like image 621
AndreasT Avatar asked Nov 05 '22 12:11

AndreasT


1 Answers

"svn rm" with a URL seems to work fine, I just tried it (using svn 1.6.5, Mac OS X):

$ svn ls -R file:///xxx/testrepo
foo/
foo/.svn/
foo/.svn/baz
foo/bar/
foo/bar/baz

$ svn rm -m 'Yes it works.' file:///xxx/testrepo/foo/.svn
Committed revision 6.

$ svn ls -R file:///xxx/testrepo
foo/
foo/bar/
foo/bar/baz

You can also use "svn mv", no need to delete anything:

$ svn ls -R file:///xxx/testrepo
foo/
foo/.svn/
foo/.svn/baz
foo/bar/
foo/bar/baz

$ svn mv -m 'Rename works too.' file:///xxx/testrepo/foo/.svn \
    file:///xxx/testrepo/foo/dotsvn
Committed revision 8.

$ svn ls -R file:///xxx/testrepo
foo/
foo/bar/
foo/bar/baz
foo/dotsvn/
foo/dotsvn/baz

PS. Creating ".svn" directories in svn repositories is easy: just use svn cp or svn mv with URLs.

like image 132
Jukka Suomela Avatar answered Nov 15 '22 13:11

Jukka Suomela