views:

39

answers:

2

Is there a way to configure hg com so that in the commit message file that pops up in the external editor, instead of just showing which files were changed (in the HG: lines) it actually shows the full diff? I'd rather view the output and compose my commit message simultaneously from the comfort of my text editor as opposed to doing hg diff on the command line separately beforehand.

+2  A: 

TortoiseHg does this out of the box: a top panel for the commit message and below that, a left pane listing the affected files and a right pane showing the diffs, one after the other.

Frank Shearar
+1  A: 

Mercurial doesn't have that as a built-in feature, but it's easy to simulate in your editor (as launched by commit).

Here's an example using VIM: http://mercurial.selenic.com/wiki/DiffsInCommitMessageInVIM

The hgeditor script http://mercurial.selenic.com/hg/hg-stable/raw-file/tip/hgeditor provides further examples.

The basic jist is:

  1. at editor launch run hg diff redirecting to a temp file
  2. have your editor load both the commit message file and the diff
Ry4an