title: Finding changesets in mercurial by grepping the patch
body: <p>Is there a way in mercurial to find a change by giving a pattern in the edit (the changed code), as opposed to the log message or filename?  </p>
  
  <p>I've looked pretty thoroughly in "hg help revsets" and I think there's not a good way to do this.  Here's the best hack I came up with, but I'm hoping I missed a capability, or that someone can do a little better.</p>
  
  <p><code>hg log -M -u goldberg -p | grep '(^changeset:\|<code>&lt;pattern&gt;</code>)' | grep -C 1 '<code>&lt;pattern&gt;</code>'</code></p>
  
  <p>(and then manually selecting the revision number for later work with those revisions)</p>