Source

involving /

This extension provides an "involving" command. This command lists, in
descending order, commits containing the query string in the commit
message, the user name, or in the names of affected files. In other
words, this is an alias for "hg log -r 'sort(grep("\b...") [and ...],
-rev)'".
If the query string ends with a number, grep will not match words that
contain more numbers (i.e., "issue26" won't match "issue260"). To
disable this behavior, add "*" to the end of query (this can also be
added to the beginning of the query).
Any extra "-r" options are added to the query using the "and"
keyword. So, for example, "hg involving -r 'branch(stable)' foo"
searches for changes involving "foo" on the stable branch only.