RFC: MQ patch reordering

Frank Kingswood frank at kingswood-consulting.co.uk
Fri Jan 29 10:25:38 CST 2010


timeless wrote:
>> 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).

I see, that would require patches themselves to be transformed which is more 
tricky. But the semantics would be the same as a "slow stupid" version, so 
that might be a step on the way.
I haven't looked into the MQ source, does it do things like this already?

Greg Ward wrote:
 > My idea is very minimal and low-ambition:
 >
 >   hg qreorder
 >
 > should run my editor on .hg/patches/series, with some friendly help
 > text ("HG: blah blah blah"), and then validate the results afterwards.

I was hoping for something that runs unattended and could be used to 
implement (for example) the TortoiseHg GUI.

So perhaps something like

	hg qreorder [--before <PATCH1> | --after <PATCH1>] PATCH2...

perhaps defaulting to --before qtip.

and smart enough to work out what to do irrespective of whether the patches 
are pushed on the stack or not.

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