Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search in SVN repository for a file name

People also ask

Where is svn repository located?

http:// or https:// This is svn over http or https. You need to find the virtual host in your apache configuration and look for a <Location> section that matches your url path and look for a SVNPath or SVNParentPath config line. This will tell you the location of your subversion repository.

What is repo browser in svn?

The Subversion Repository browser enables you to add or discard repository locations, view the history of files and folders, check out files and folders, navigate to the source code, browse changes, create branches or tags, and so on.


The following works for me (svn version 1.4.6)

svn list -R <URL> | grep "<file_pattern>"

If the file is in your working copy, then if you are using svn 1.5:

svn list --depth infinity | grep <filename>

or an earlier version of svn:

find . -name <filename> -not -path '*.svn*'

If you need to find the file in history (deleted or moved):

svn log -v | less

and search for it with:

\<filename><return>

With access to the repo itself use (i.e on your svn host file sytem)

svnlook tree [path_to_repo] | grep [file_name]  

or to search all repos (if you have mulitple repos setup).

for i in \`ls [path_to_repos_dir]`; do echo $i; svnlook tree [path_to_repos_dir]/$i | grep -i [file_or_folder_name]; done 

the option --full-paths will give the full path in repo to the file (if found)

example:

for i in `ls /u01/svn-1.6.17/repos`; do echo $i; svnlook tree --full-paths /u01/svn- 1.6.17/repos/$i | grep -i somefile.txt; done

redirect output to a file if static copy is needed.
assumes using nix OS.


svn list --depth infinity <your-repo-here> to get a list of files in the repo, and then svn cat to get contents. You can add --xml key to list command to make parsing a bit simpler.


Recently I've published my utility to list the repository, that's much faster than "svn ls --depth infinity" approach. Here're the benchmarks. It just calls a function that is available in Subversion internal API, but now accessible through a command line.

So you can run

$ svn-crawler <URL> | grep "<file_pattern>"