List all file versions in a disruptive program? (Delete files by name)

Some smart dudes in the office managed to transfer a whole bunch of β€œbackup” files (they start with ._ ) to our subversion server.

It is advisable that these files be deleted using the base bash script, and not through the repository manually.

Is there any way to get a list of all files with subversion version in a directory so that I can perform some basic grepping / svn deletions?

edit:

'svn list' is not recursive and seems to list directories as well, I need behavior like "find".

second edit:

Well, the -R flag can make the 'svn list' recursive ... but how do I cut directories?

+6
svn grep find
source share
3 answers

If it is in only one commit (or series of commits), use svn merge to undo it.

If the user does this after a few commits, and you are on Linux:

First, check the listing of the files you want to delete:

 find . -name '._*' 

Then actually invoke svn to remove them:

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

Check svn status, fix if this is good.

Disclaimer: I have not tested the commands, so be careful.

I think these are Mac backup files that it makes automatically.

+4
source share
 svn list -R 

lists all files and directory recursively

+5
source share

How to cut directories?

The key is to ensure that directories end with a slash.

Then you can use grep.

 svn list -R my_svn_dir | grep -v '/$' 
+3
source share

All Articles