Chris Thornton
Chris Thornton

Reputation: 15817

How to search SVN repository for a file when I'm not sure where I put it?

Co-worker is sure he checked in a file: foo_oustanding.dpr but isn't sure when/where (we have lots of "tools" and "utility" ancillary branches, lots of project branches, etc..
I need a way to search the entire repository for this file. I could check the whole source tree out to my HD, but that would take several hours. Is there a faster way? I tried the Repo Browser (Tortoise) and it didn't seem to have a search. I also thought about dumping the log, from the beginning of time. But that seemed silly.

I have, at my disposal:

Upvotes: 27

Views: 56115

Answers (6)

Peter Šamperl
Peter Šamperl

Reputation: 21

I search like this:

svn list -R url_to_repo | grep Maintain.jar

It outputs this:

trunk/Project/pkg/Release/Maintain.jar

Upvotes: 2

Lazy Badger
Lazy Badger

Reputation: 97280

With Subversion 1.8+ client:

svn log -v URL-OF-REPO-ROOT --search foo_oustanding.dpr

Upvotes: 10

live-love
live-love

Reputation: 52366

To see a list of all the files, send grep to text file in Command Prompt:

svn list -R myurl >> results.txt 

Upvotes: 15

Ken Liu
Ken Liu

Reputation: 22914

If it was checked in fairly recently, you could do a verbose remote svn log from the top of the tree and see a history of all the commits across all the branches. You could then grep the output for the file and user name. (You would need the command line svn to do this.)

svn log -v -l 500 http://myserver/svn_root

Upvotes: 10

Pekka
Pekka

Reputation: 449395

Good question! There doesn't seem to be an official "search" function in Tortoise, but it seems to be possible to search the log in TortoiseSVN for file names, which can be enough in many cases.

Upvotes: 7

Erikk Ross
Erikk Ross

Reputation: 2183

See this question and answers:

SVN Repository Search

svnquery is probably what you need.

Upvotes: 2

Related Questions