views:

1859

answers:

2

How can I search if a file named foo.txt was ever committed to my svn repositroy (in any revision)?

+3  A: 

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. :)

Adam Bellaire
That'd work. You could filter for the first occurrence with 'svn ... | grep /foo.txt | head -1'
orip
+4  A: 
Martijn Laarman