I have the feeling that hg grep
is looking for the contents of the entire file for each corresponding revision. If you want to search for diff only, try something like this:
hg log --template "{ifcontains('TODO', diff(), '{node} {desc}\n', '')}"
This list will list versions containing "TODO". Please note that this will also remove the search strings as well as the diff context (+/- 3 strings), so it is not ideal.
You can limit the further use of args for diff () - see hg help template
- and using revsets ( -r ...
).
It might be better than using your hg diff | grep
hg diff | grep
, because it distinguishes each set of changes one by one, instead of distinguishing all repos on two sets of changes and allows you to use, for example, revsets to filter merge versions.
source share