Stephen
Stephen

Reputation: 19944

How do I search historic mercurial file content?

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...

Upvotes: 42

Views: 8603

Answers (3)

arhak
arhak

Reputation: 2542

hg grep --all --files-with-matches MyKeyword

see hg help grep

Upvotes: 1

Stephen
Stephen

Reputation: 19944

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

Upvotes: 28

Chris Morgan
Chris Morgan

Reputation: 90712

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.

Upvotes: 42

Related Questions