[PATCH 2 of 2] rollback: tell the user their previous commit message was saved

Greg Ward greg-hg at gerg.ca
Sat Nov 21 18:46:43 CST 2009


On Sat, Nov 21, 2009 at 7:11 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Sat, 2009-11-21 at 17:11 -0500, Greg Ward wrote:
>> # HG changeset patch
>> # User Greg Ward <greg-hg at gerg.ca>
>> # Date 1258840694 18000
>> # Node ID 70532501cffb1b5869f1f97c4bac10262b98dfb4
>> # Parent  14424eaaae621395167ace250d6e48488ff75519
>> rollback: tell the user their previous commit message was saved
>> (issue1635)
>
> I don't think this is the right place for this message as it'll be shown
> for unrelated rollbacks.

Agreed, but I have several excuses:
  * at least for me, rollback most commonly rolls back one commit
  * it's not until you rollback that you need to know where your
    precious commit message was saved

> Better places:
>
> commands.py:commit
> localrepo.commit
> localrepo.commitctx
>
> We might also want to skip the message if we used -m.

IMHO the most sensible place to print the message is when we write
.hg/message, which is localrepo.commit().  I'll see what I can come up
with.

I suspect this feature will be used mostly by people familar with
svn's similar behaviour.  I know the first time rollback ate my commit
message, I went looking for the local equivalent of .svn/COMMIT-MSG
(or whatever it is).

Greg


More information about the Mercurial-devel mailing list