Messages in patches

Giorgos Keramidas keramida at ceid.upatras.gr
Fri Aug 3 19:30:53 CDT 2007


On 2007-08-03 17:39, Insitu <abailly at oqube.com> wrote:
>Patrick M?zard <pmezard at gmail.com> writes:
>> Insitu a ?crit :
>>> My question is: I would like my messages to be aggregated when doing
>>> hg qrefresh. They seem to be replaced right now. Is this possible ?
>>
>> Why not use qrefresh -e and edit the message directly ?
>
> I overlooked this option, thank you.
>
>> BTW, if you need to aggregate comments, it looks like you are
>> aggregating features too. If so, why not keep those features separated
>> until you really need a single patch and use qfold to aggregate them
>> (with their message being concatenated) ?
>
> Well, not really I think. I just want to keep a running account of
> what I am doing and using the log message seemed fine.

It may be useful to note here that MQ can 'version' the patch sets, and
'qcommit' can be used to keep a change log of the patch queue itself.

You can convert the patch queue to a 'patch repository' with:

        hg qinit -c

Then the .hg/patches/ directory is a Mercurial repository too, and you
can alternate between:

        hg qrefresh -e
        hg qcommit

This will let you keep your patch queue versioned too, and you will be
able to track the changes to your patches as they evolve over time.

I often use MQ to keep a stack of patches on top of a snapshot of the
'official' source tree at work, and using 'qinit -c' with 'qcommit' lets
me develop the patches themselves in small steps.  This is very useful
some times, i.e. when I qrefresh at the wrong moment it's marvellously
easy to roll back bogus patch changes by popping the stack of patches
and running:

        hg qpop -a
	( cd .hg/patches ; rm -f * ; hg up -C )
	hg qpush -a

This restores the patch queue to a 'known good state', the state of the
last 'hg qcommit' operation, and I can keep massaging the patches until
they have the precise shape and contents I want them to have.

Maybe something like this, based on 'qinit -c' and 'qcommit' can help
you track the state of your patches too :-)

- Giorgos



More information about the Mercurial mailing list