tags:

views:

192

answers:

3

Hi,

probably this is a very easy question but I did not find yet how to delete all files present at the moment in a external svn repository.

I can delete just one file using:

svn delete -m "delete README" http://myrepo.com/svn/myrepo/README

But now I want to delete all of them. I thought about a script which gets the list of all the files of the repository and afterwards deletes them one by one, but this is tedious, do you know a simpler solution?

I also tried

svn rm http://myrepo.com/svn/myrepo svn delete http://myrepo.com/svn/myrepo/*

But nothing

Thanks

A: 

You didn't say which platform you're on.

If you're on Windows and you have TortoiseSVN installed, you can search for all the files in the folder hierarchy using the explorer, mark all resulting files, and remove them using Tortoise.

If you're on some Unix derivate (includes OSX), you can probably do something similar in your favorite shell.

sbi
+2  A: 

You could do a shallow checkout and then delete all.

Example:

svn checkout --depth immediates http://myrepo.com/svn/myrepo myworking_copy
cd myworking_copy
svn rm *
svn ci -m "Deleting all"
Lance Rushing
+1, simple and works
orip
hithis solution seems really simple and good. I tried it, but got errors, and then updated to the last version of SVN. Then it recognized the --depth option but I still got this error:http://subversion.tigris.org/faq.html#unrecognized-url-errorSo it seems my installation of SVN was not good. As I was running out of time I tried TortoiseSVN (sadly only for win$), browsed the repo and deleted all files there :)Anyway I will solve the installation of svn laterthanks
Werner
+1  A: 

You can svn rm a sub-path in the repos, but not the repos itself. For the future a trunk / branches / tags structure will probably fit you better.

To delete them with some bash/zsh magic:

REPO=http://myrepo.com/svn/myrepo && svn rm `svn ls $REPO | sed "s/^/$REPO\//"`

which will expand to

svn rm http://myrepo.com/svn/myrepo/file_1 http://myrepo.com/svn/myrepo/file_2 ...
orip