tags:

views:

101

answers:

1

I need to search through all revisions of a Subversion repository to find file names and revision numbers that contain a particular string. I know that this will find occurrences in a dump:

svnadmin dump $REPO_PATH | grep -i "Verdana"

but the output is too cryptic. The output will include chunks of binary files that match.

I have been using commands like this to search for strings in the current working copy of a project:

find . -name "*.css" -print0 | xargs -0 grep "Verdana"

The format of the output is useful, it give both filename and the line in which the string occurred:

./css/forms.css: font       : 12px Verdana;

Is there any way to search all revisions of an SVN repository for say, all .css files that contain a search string? And not just a word but a string with wildcards or a regular expression like grep?

Note: I have root access to the Linux server with the repository on it.

A: 

Have you tried

svn log --verbose

on your root directory, printing each log message and all affected paths. It won't let you parse the file contents, but you my at least be able to search for .css files.

zellus
Yes, there seems to be many solutions to searching for file names. Content is trickier.
Liam
You could use 'diff' in order to generate plain text output between that latest version and any previous revision. Maybe you can even limit the 'diff' to certain files, based on the results of 'svn log'.
zellus
zellus