开发者

List of all versioned files in subversion? (Remove files by name)

Some smart dude at the office managed to开发者_如何学C 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?


svn list -R

lists all files and directory recursively


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.


how do I strip out directories?

The key is to observe the directories will end with a slash.

You can then use grep.

svn list -R my_svn_dir | grep -v '/$'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜