how to use tortoisehg's search tools?

esther h picture esther h · Jun 12, 2012 · Viewed 14.1k times · Source

I want to search for a specific phrase (ie "comma_delimited") in a specific file (ie "index.php") in a specific branch (ie "ABC-123"). The reason for this is, that text is no longer in the file, and I want to see at which commit it was taken out, without looking at every revision of this file on this branch.

Is there a way to do this in tortoisehg? I see there is a Search button which brings up a search panel where you can enter patterns, but I have no clue how to use it (and don't know how to write patterns), and after googling for some time, found no useful info on it.

Thanks

Answer

Steve Kaye picture Steve Kaye · Jun 12, 2012

There are two search buttons - one to search the repository and the other is to filter the revision graph. Maybe you pressed the wrong one?

If you use the menu to select View / Search this selects the search view that you want.

It should show you a large panel below the revision graph with a number of controls to fill in.

  • Enter "comma_delimited" into the first edit control (on the same line as the Search and Stop buttons which are on the right)
  • Select the "All History" radio button below that edit control.
  • Enter **index.php into the edit control labelled "Includes" (or the full path to index.php if you have more than one and want to limit the search to a particular file)
  • Press the Search button

The list at the bottom of the window should now show details of the revisions that include that phrase. It will show when it was added (prefixed with a '+') and when it was removed (prefixed with a '-')

Here's an example search window: Example search window