views:

25

answers:

2

I have a Mercurial Repository for a code project and I want to search all of the files, in all directories and sub-directories, for a given string. What is the best method, or program to do so?

I can conduct this search in Ubuntu Linux or a Windows environment.

+1  A: 

Probably best to just do a checkout of the repository and use grepWin on windows, or grep on Linux.

Ryu
You have a good example of that for Linux? The string I wish to search for is something along the lines of abUser, and the case is the same everywhere (or the code wouldn't work). Probably a stupid question, but I can't get my mind around it this morning :-\
Urda
BAM. Once I have my coffee I am no longer stupid. No need for a program >< user:~$ grep -r -i abUser /home/user/Mercurial/workRepos/myTool/default-Branch/ > myGrep.txt
Urda
+1 for the grepWin app though, I am going to keep that for later on down the road.
Urda
A: 

For a simple search in the working copy, I would also use the normal grep program (I'm on Linux).

But if you want to search the history for a string, then note that Mercurial also has a hg grep function. That can be handy if you want to see when a given function, say, was introduced or removed.

Martin Geisler