how can I search an svn repository for the existence of files in any revision

Use Subversion 1.8+ client and new --search and --search-and options become available for svn log command. These options do not allow perform full-text search inside a repository and looks up the following data only:

  • revision's author (svn:author unversioned property),
  • date (svn:date unversioned property),
  • log message text (svn:log unversioned property),
  • list of changed paths (i.e. paths affected by the particular revision).

As far as I guess, you can search for "foo.txt" with the following command line:

svn log -v --search "foo.txt".

Here is the complete help page about these new svn log search options:

 If the --search option is used, log messages are displayed only if the
 provided search pattern matches any of the author, date, log message
 text (unless --quiet is used), or, if the --verbose option is also
 provided, a changed path.
 The search pattern may include "glob syntax" wildcards:
     ?      matches any single character
     *      matches a sequence of arbitrary characters
     [abc]  matches any of the characters listed inside the brackets
 If multiple --search options are provided, a log message is shown if
 it matches any of the provided search patterns. If the --search-and
 option is used, that option's argument is combined with the pattern
 from the previous --search or --search-and option, and a log message
 is shown only if it matches the combined search pattern.
 If --limit is used in combination with --search, --limit restricts the
 number of log messages searched, rather than restricting the output
 to a particular number of matching log messages.

This should work for you:

svn log -r 0:HEAD -v $REPOSITORY_PATH | grep "/foo.txt"

This will give you the paths to the files and the state from the log. If you get any hits, you know it existed at some point. If you get no results, there is nothing matching anywhere in the repository at any revision. You'll also see the states from each log line, e.g.:

   A /some/path/foo.txt
   D /some/path/foo.txt

But I'm guessing the extra info isn't a problem for you. :)


Right click on the checked out folder's root > TortoiseSVN > Show Log

You can enter file names just as well there.