Love Gupta
Love Gupta

Reputation: 975

Searching the SVN repository

I have gone through many links on this site and others but I could not find a helpful link helping me in indexing my SVN repository and then allowing me to search anything - comments, author, revision, file name, content of file etc.

I need a tool to search my complete repository. I tried SVN search its Indexer part was giving me an error "svn: Malformed network data".

One more thing I don't want any command line solution, I want a UI for this.

It will be helpful even if I get any indexer so that I can develop my own UI on the top of it.

PS - Researched about SVN query but not getting any resource for it. SupoSE looks like a closed project so I'm thinking of not using it.

Upvotes: 2

Views: 4867

Answers (5)

bahrep
bahrep

Reputation: 30662

VisualSVN Server 4.2 supports searching by file or directory name. Try this feature on the demo server and download VisualSVN Server from the main download page.

enter image description here


Old answer

Use the --search option with the svn log command. Note that this command does not perform full-text search inside a repository, it considers 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).

Upvotes: 0

Reece
Reece

Reputation: 691

Definitely some valid suggestions above; don't want to detract from their relevance - but I found them all a bit over blown for what I wanted (just wanted to scan all our svn repos to look for Google Analytics UA codes so I know what projects to migrate to Firebase) so I wrote my own bash script:

#! /bin/bash
while read line; do
svn checkout https://your-svn-server.com/$line
find $line/ -type f -exec grep -H 'text you want to search for' {} \; >> svn-log.txt
rm -rf $line
done < svn-list.txt

This checks out each repo one by one; scans them, then deletes the local copy of that repo & then checks out the next one. svn-lines.txt is a list of all of your svn repo names. The script assumes your your shell is already authorized to checkout all the repos in the list. Instead of listing all of your repos in svn-list.txt you could incorporate the 'svn list' command into this script. I didn't because our SVN server doesn't support that command at the top level.

Information regarding the files that are found to contain the search string is stored in svn-log.txt

Upvotes: 0

Love Gupta
Love Gupta

Reputation: 975

The best tool for searching through subversion is SVNQUERY. This tool helps in Indexing and then searching. It provides the mechanism of Web Searching as well as windows searching. Even it provides you with dll to use in ur own application. For more details about svn query visit http://svnquery.tigris.org/.

Upvotes: 0

William Leara
William Leara

Reputation: 10687

I'm not sure what you mean by:

Researched about sVN query but not gettig any resource for it

site:
http://svnquery.tigris.org/

wiki:
http://svnquery.tigris.org/wiki/FrontPage

documentation:
http://svnquery.tigris.org/servlets/ProjectProcess?pageID=o0dpdE

demo:
http://svnquery.tigris.org/servlets/ProjectProcess?pageID=g8GcCC

In my experience SVNQuery is very popular, well-supported, and free.

Upvotes: 2

Lazy Badger
Lazy Badger

Reputation: 97282

Just idea:

  • Clone SVN-repo to Mercurial (hg + hgsubversion)
  • Use native hg-tools for search inside repo (grep, revsets /revset's keywords/)

Upvotes: 1

Related Questions