RFC: MQ patch reordering

Frank Kingswood frank at kingswood-consulting.co.uk
Fri Jan 29 03:50:45 CST 2010


Hi!

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:

#!/bin/sh
set -e
for PATCH in "$@" ; do
    hg qpop
    hg qnew $(date +hg-qbefore-%s)
    hg qfold "$PATCH"
    hg qrename "$PATCH"
    hg qpush
done

The script takes the name of one or more patches and moves them before the 
current qtop in the order specified.

With some effort all other patch reordering functions can be expressed in 
terms of qbefore, but more convenient semantics may be possible.

This really looks like the sort of thing that should be internal to MQ,
especially as there are other users of this functionality, such as GUIs.

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.

Frank
-- 
------------------------------------------------------------------------
Frank A. Kingswood                      frank at kingswood-consulting.co.uk
Cambridge, United Kingdom                               +44-870-095 0000


More information about the Mercurial-devel mailing list