Since 2016, you can do this using the committemplate configuration option. Adding the following to the hgrc file will include diff in the editor window when you type a commit message.
[committemplate] changeset = {desc}\n\n HG: {extramsg} HG: user: {author}\n{ifeq(p2rev, "-1", "", "HG: branch merge\n") }HG: branch '{branch}'\n{if(currentbookmark, "HG: bookmark '{currentbookmark}'\n") }{subrepos % "HG: subrepo {subrepo}\n" } {splitlines(diff()) % 'HG: {line}\n'}
For more information, see hg help hgrc and search for committemplate .
ngoldbaum
source share