Matt Mackall <mpm@selenic.com> [Mon, 10 Dec 2007 10:24:29 -0600] rev 5637
commit: avoid losing edits during commit
If a file is edited between the time we record file states in the repo
and update the dirstate, that change can be lost to hg status. Because
we invoke the editor between these two points, that window can be
arbitrarily large.
This greatly shrinks the window by recording the commit change
immediately. If our checkin fails, we simply invalidate the dirstate.