RFC: MQ patch reordering

timeless timeless at gmail.com
Fri Jan 29 04:13:41 CST 2010


On Fri, Jan 29, 2010 at 11:50 AM, Frank Kingswood
<frank at kingswood-consulting.co.uk> wrote:
> I frequently find myself reordering patches in a MQ queue. That often means
> hacking the series file, which is a bit risky.
>
> So I wrote a little script hg-qbefore:

> Before I submit any patches to add this to the MQ extension, I would like to
> see some discussion about the semantics that would be most convenient.

So. my major work is on mozilla-central, and my mq is 100-200 items
long. hg qpop/qpush end up being very expensive. So for qreorder
tasks, I really am hoping to get someone to implement a version where
the repository is changed without changing the working directory.

roughly, if you have:

a => b => c => d (*)

and you want to swap b and d, ideally the working directory for:

a => d => c => b (*)

should be equivalent (whereas the working directories at c would not be).

In a small tree, a bunch of qpop/qpush commands rewriting the working
directory isn't interesting, but in mozilla-central, they're very
expensive.

This is of course tangential to the actual command name, since i'm
basically asking for a version which does _not_ have an observable
change (other than speed, since it should just generate new patches,
write new changesets, write new series file, debugsetparent, replace
series file, strip the old changesets).

I'm not quite sure that 'qbefore' is what i want, i'll need to think
about it a bit. I think I typically want to say "qplace-(before|after)
anchor patch1 patch2 ...."

where anchor is a patch-series-name or something like 'qparent' (for
qplace-after at least...) and patches are placed relative to it.

for my example:
qplace-after a d

to change from:
a => b => c => d (*)
to:
c => a => b => d (*)

qplace-after qparent c
or
qplace-before qbase c


More information about the Mercurial-devel mailing list