Amending a changeset
Christian Boos
cboos at neuf.fr
Tue Apr 22 09:42:47 CDT 2008
Giorgos Keramidas wrote:
> On Tue, 22 Apr 2008 11:10:27 +0200, Christian Boos <cboos at neuf.fr> wrote:
>
>> leslie.polzer at gmx.net wrote:
>>
>>> Hello,
>>>
>>> in a recent changeset some changes that semantically belong to it are missing.
>>> In Darcs I would now use AMEND-RECORD to add the remaining changes (they
>>> are in the working copy right now and have not been committed yet).
>>>
>>> Is there a way to do this in hg?
>>>
>> `hg rollback', then: `hg ci' again and this will now contain the new
>> changes as well.
>>
>> The only feature I miss in the above sequence is that the original
>> commit message is lost, so you actually have to remember to do something
>> like:
>> hg tip --template '{desc}' > msg
>> before doing the rollback.
>>
>> An `hg amend' extension automating the above would be handy (or maybe
>> this could be grafted in the 'record' extension, as an --amend option?)
>>
>
> You can keep the original message (or even 'amend' it too), by using the
> MQ extension to refresh/extend the latest 'tip' changeset:
>
> # Import the latest 'tip' to an MQ-controlled patch.
>
> hg qimport --git -r tip
>
> # Make some local workspace changes.
I never thought about doing that when I had pending local changes, but
it appears to work fine in this situation as well.
Thanks for the hint!
-- Christian
More information about the Mercurial
mailing list