tags:

views:

127

answers:

3

Hi there. 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.

A: 

Delete it from the actual file system on the box, then try an svn delete.

Woot4Moo
No. Sorry. Even if I do "svn rm ..." directly on the repo, it complains about the reserved argument and refuses to do anything.
AndreasT
No what I mean is to do a rm .svn if on unix or to navigate to the actual file on the box and right click delete it.
Woot4Moo
and what should that help? The .svn directory in the repo does not even get checked out, since svn places it's control directory there first. svn co says: "skipped '.svn', file or directory of the same name already exists."
AndreasT
it sounded to me that the file was living on the file system, my mistake if that in fact was not the case.
Woot4Moo
no, my mistake, I could have mentioned that. Thx anyway.
AndreasT
A: 

Just svn delete it from the repository directly, e.g.,

svn rm -m "removing checked-in .svn" http://myserver/svn/repo/trunk/dir/.svn

then delete your local copy and svn update to retrieve the corrected version.

Zac Thompson
This does not work as svn delete does also not accept .svn as parameter. This is what I meant by "If I tell svn to delete it..." in my question text.
AndreasT
+1  A: 

"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.

Jukka Suomela