[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: how to search body of all revisions?

From: Kevin Grover <kevin_at_kevingrover.net>
Date: Tue, 19 Jan 2010 13:43:34 -0800

On Tue, Jan 19, 2010 at 6:39 AM, saurabh kumar <saurabh9_at_gmail.com> wrote:

> Hi,
> A coder apparently overwrote some piece of code and then future revisions
> naturally did not have that piece of code.
> I need to find which revision had that piece of text.
> Is there a way I can search across all revisions to find that piece of text
> for a given file in my repository?
> ------------------------------------------------------
> http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=2440263
> To unsubscribe from this discussion, e-mail: [
> users-unsubscribe_at_tortoisesvn.tigris.org].

You can use svn blame to look for changes to the file(s) of interest. Other
than that, the easiest thing I've found it to clone to repository into
Mercurial and use "hg grep"

hg convert svn://server/repo repo-hg
cd repo-hg
hg grep "Some String Regexp" # Perl/Python style regexp

* this prints the first revision of each file to contain the text. If you
use '-all' it should print all versions and you look for the last revision
of the file of concern.
* You'll probably want to save the output of the hg convert so you can map
svn revisions to the hg revisions they are pretty much 1 for 1, except for
svn property only revisions (which hg does not have so it drops them).
* You need to turn the 'convert' extension on in hg (normally it comes
commented out), you just find the hgrc file and uncomment that line.

Good luck


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2010-01-19 22:43:41 CET

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.