is there a way to search a set of diffs for a particular string for a file?

mercurial

Solution

You can use `hg grep` to search the entire repo history.

For example:

hg grep --all --include .\TheFile.cs 'theSearch'

will find all instances of `'theSearch'` in every revision of the repo. Without the `--all` flag, it stops at the first revision that includes the string.

Problem

I'd like to search the diffs of one file (ideally a set of files) for a specified set of revisions (or all). I'm looking for a diff report that is text searchable. I've got this: `hg diff -r 0:47131 .\TheFile.cs | grep 'theSearch' -Context 50` OK, that works well enough, but deciding how much context to include is an issue as well as finding the first and last revision. I can automate this better but it seems like it'll be a bit of work. I'm wondering if there's a tool out there that will do this better. Maybe a diff report web page for the hg server?

Original source