Managing independent patches

Christian Boos cboos at neuf.fr
Mon Apr 7 10:37:47 CDT 2008


Paul Moore wrote:
> On 05/04/2008, Paul Moore <p.f.moore at gmail.com> wrote:
>   
>> On 05/04/2008, Christian Boos <cboos at neuf.fr> wrote:
>>  >  I've been quite interested by this discussion, as I also use MQ to manage
>>  > mostly independent patches.
>>  >  I'm adding some notes about hg qupdate, and I also propose an alternative
>>  > solution, which is to address the problem by using multiple patch queues in
>>  > the same working directory.
>> ...
> At a quick look, I see you've implemented this as a set of shell
> commands. As I'm on Windows, I can't use these directly, but I like
> the concept a lot. I'll see how hard it would be to make it into an
> extension.
>
>   

No excuses, I work on Windows as well, but in a cygwin bash shell ;-)
Yes, it's currently a set of Bash functions, as I find it easier that 
way to experiment and try to get the concept right. Writing an extension 
could be done as a second step, once the prototype is OK.

So here's a new version of the MMQ script, a lots of things have been 
fixed and improved.

The main commands have been renamed to 'qswitch', 'qlist' and 'qwhich'.

The operation used for switching off a queue has been renamed 'qquit' 
('qpark' was considered, but in anticipation of the extension, I've 
found the future shorthand 'qq' to be nicer).

The splitting operation has been rewritten and is much more useful now: 
you can move patches to either a new queue or to an existing one (on top 
of the patches already applied there). This actually comes in two 
flavor: 'qsplit' for moving the applied patches, and 'qtruncate' for 
moving the unapplied patches. Together with the 'hg qup', this enables 
you to move any patch around in a controlled way.

The splitting can be used to break down an existing queue containing 
lots of unrelated patches into new separate queues very quickly (if no 
queue name is given, the name of the first moved patch will be taken).
Conversely, splitting can also be used to regroup queues when needed. 
This can be useful when your queues are individually ready, but you'd 
like to make sure they'll apply well in a sequence. So you can split all 
the queues which are ready to a single "outgoing" queue.

Now, I'll look at ways to add merge support, so that rebasing can happen 
transparently when switching.
The idea is to remember the qbase revision when 'qquit'ting and see if 
that has changed when 'qswitch'ing back.
If that's the case, the qsave -e -c  / push -a -m  procedure described 
in the hgbook will be performed.

-- Christian





-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mmq.sh
Url: http://selenic.com/pipermail/mercurial/attachments/20080407/83430be9/attachment.txt 


More information about the Mercurial mailing list