changing commit comments

Ted Pavlic ted at tedpavlic.com
Tue Jul 15 11:59:16 UTC 2008


>> when that's not important, one could probably hack something together
>> on top of mercurial queues.
> 
> hg qimport -r tip
> hg qrefresh -m "New message"        (or hg qrefresh -e)
> hg qdel -r qtip

Actually, it's safer to do:

   hg qimport -gr tip
   hg qrefresh -gm "New message"       (or hg qrefresh -ge)
   hg qdel -r qtip

The g's force MQ to use git diff. Without git diff, MQ can obliterate 
binary files in your manifest. You can add "--git" to your ~/.hgrc 
defaults for qimport, qdiff, qnew, and qrefresh. In that case, you can 
omit the g's here.

As mentioned, the process is a little more complicated for commit 
messages a while ago... and you blow away changeset ID's for every 
changeset you import to MQ. You'd so something like...

   hg qimport -r revision_to_change:tip
   hg qgoto revision_to_change        (or hg qpop revision_to_change)
   hg qrefresh -gm "New message"      (or hg qrefresh -ge)
   hg qpush -a
   hg qdel -r qbase:qtip

--Ted

-- 
Ted Pavlic <ted at tedpavlic.com>



More information about the Mercurial mailing list