tags:

views:

27

answers:

2

Some smart dude at the office managed to commit a whole bunch of 'backup' files (they start with ._) to our subversion server.

Preferably I would like to delete these files using some basic bash script instead of going through the repository manually.

Is there any way I can get a list of all subversion versioned files inside a directory so I can do some basic grepping / svn deletes?

edit:

'svn list' isn't recursive and also seems to list directories, I need the kind of behavior like 'find'.

second edit:

Ok, the -R flag can make 'svn list' recursive... but how do I strip out directories?

+1  A: 
svn list -R

lists all files and directory recursively

Nikolaus Gradwohl
+2  A: 

If it's only in one commit (or series of commits) then use svn merge to undo it.

If the user has been doing it across several commits and you're on Linux:

First check that this properly lists the files you want to delete:

find . -name '._*'

Then actually invoke svn to delete them:

find . -name '._*' -exec svn rm {} \;

Check svn status, commit if good.

Disclaimer: I have not tested the commands so beware.

I think those are Mac backup files it makes automatically.

Rob Olmos
That worked beautifully, thanks :) And yeah, the guy is using a mac.
Daniel