Rollback ate my commit message! (issue 1635)

Greg Ward greg-hg at gerg.ca
Wed Nov 18 12:30:28 CST 2009


On Tue, Nov 17, 2009 at 9:38 PM, Matt Mackall <mpm at selenic.com> wrote:
>> So Mercurial rolls back the transaction.  Your beautiful patch is
>> still there in the working dir, of course.  But that carefully crafted
>> commit message?  Gone.  Poof!
>
> Why not save off the message in either:
>
> a) your commit edit helper
> b) a pretxncommit hook of your own

Sure, there are lots of ways I could fix this that benefit only me and
my colleagues.  But this annoyance can affect anyone using Mercurial.
("Oops! typo in that commit message! I'll just rollback and fix it ...
oh. wait. rollback ate my commit message.  @^%!^@^@#")  And it's even
more likely to bite anyone using a pretxncommit hook with teeth.

So I am proposing to fix it in a way that benefits all Mercurial users
all of the time.  Cost: 3 lines of code and a little extra I/O for
each commit.  If you really don't think it's worth it, then I'll just
do it early in our pretxncommit hook.  It will stop annoying me, and
will continue to annoy the invisible people who don't complain.
(Possibly an empty set, but I doubt it.)

As for "a) your commit edit helper", do you mean a mythical shell
script run by hg that in turn runs my $EDITOR?  But I don't have one,
and don't want to need one.  I've never needed one with CVS or
Subversion, so why should I need one for Mercurial?  Oh yeah...
because rollback ate my commit message, and that doesn't happen with
CVS or Subversion -- even when a server-side commit hook rejects my
commit.

Greg


More information about the Mercurial-devel mailing list