41

I've found an issue in my code where something used to be specified, but is no longer, so I want to search for a particular string through the history of the repository.

Is there a way to do this in TortoiseHg? I know it would take a while, but it'd take me longer...

Stephen
  • 19,488
  • 10
  • 62
  • 83

2 Answers2

42

If you don't mind working with Mercurial via the command line, there's hg grep. It's probably exposed somewhere in the TortoiseHg Workbench, but I don't know.

Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
  • Wow! That was awesome! Much faster than our fisheye server (on svn); and it's specific to my repository! – Stephen Dec 01 '11 at 00:10
  • Yep, the way hg stores it all locally helps to make such things fast and helpful. – Chris Morgan Dec 01 '11 at 01:18
  • TortoiseHg Workbench: The second icon from right is "Search" and the 6th icon from the left is "Filter Graph" (this shows up as "Filter Toolbar" in the pulldown menus). You probably want the "Search" function. – Gili Jul 22 '14 at 16:28
  • To search a specific file: hg grep 'somestring' -l "fileA.js" – hello_harry Jan 11 '16 at 15:21
28

Menu "View" -> "Search". This will open the search pane which you can use to search for strings inside your

  • working copy, all history, specific revision
  • with inclusion file patterns
  • and exclusion file patterns
Stephen
  • 19,488
  • 10
  • 62
  • 83