hg commit doesn't catch changes made during editing of commit messages

Bryan O'Sullivan bos at serpentine.com
Wed Aug 24 13:48:43 CDT 2005

On Wed, 2005-08-24 at 14:22 -0400, Dan Christensen wrote:

> I've done this "change a file while editing the commit message"
> several times, and also noticed a problem or two, but always assumed 
> I was just confused (often a safe assumption).

No, what happens is that commit does everything except write the
changelog file before it fires the editor up.  That's why, if you exit
the editor, it gives you a rollback message - it really is rolling back
a partial transaction.

> Are you saying that the repo gets corrupted by the above, and
> this is a way to fix the corruption?

The repo doesn't get corrupted, but the dirstate does.  What that means
is that hg thinks that some files in the working dir are in different
states of modification than they really are.


More information about the Mercurial mailing list