[PATCH RFC] commit: add --amend option to amend the parent changeset

Arne Babenhauserheide arne_bab at web.de
Tue Feb 21 02:22:15 CST 2012

Am Montag, 20. Februar 2012, 15:42:21 schrieb Martin Geisler:
> I don't think it's "semantically wrong" if your semantics is:
>   hg commit --amend == hg rollback; hg commit
> That's how I've thought of that hypothetical flag from the beginning.
> I actually don't care much if it's a command or a flag, I'm just saying
> that I find it natural that a flag on commit would behave as rollback
> plus a new commit (with updated timestamp, of course).

I think that this is the current usecase, because it is the only simple way to 
do it. 

But actually what I want is “make the last commit look like this”, while 
retaining the usual Mercurial promises (don’t break other peoples history, 
don’t lose work, don’t get too complicated, …). 

If the commit is in draft, I likely won’t need the old commit anymore. 
Possibly I actually don’t want it to ever propagate (because I committed a 
password or so).

I might want it to be available to me, though, because I might make an error 
on the new commit which I might only catch by comparing it to the old one.

If it is already public, I will have to keep the old commit around (for me it 
looks like obsolete actually could provide ways for safely rewriting public 
history, because the obsolete changesets stay available, so it is just like an 
abandoned branch with the additional info “please rebase over here to 
integrate with the latest changes”).

Best wishes,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 316 bytes
Desc: This is a digitally signed message part.
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20120221/04ee45d8/attachment.pgp>

More information about the Mercurial-devel mailing list