Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How-to multiple hg mq patch queues (in one repository vs. many subrepos)

I am trying to set up my workflow with MQ as described in the MqTutorial and in the HGbook Chapter 13. The part I struggle with is how to have multiple patch queques under version.

Alternatives:

I. Create a separate repository for every queue. To make this manageable mark the repos as subrepos in the .hgsub file

Problem: the following results in an error: path contains illegal component

 .hg/patches-queue1 = .hg/patches-queue1

II. HGbook Chapter 13 describes that you can add patches in subdirectories like

 qnew queue1/patch1.diff

Problem: All the patches are still in the same queue and have to be applied in order

Is there another way to have all my patch queues under version control and pushed? Multiple HG MQ patch queues in one repository?

like image 894
Cilvic Avatar asked May 15 '11 09:05

Cilvic


1 Answers

Check out the hg qqueue command that's part of mq. It lets you switch multiple patch queues in an automated fashion:

hg qqueue [OPTION] [QUEUE]

manage multiple patch queues

    Supports switching between different patch queues, as well as creating new
    patch queues and deleting existing ones.

    Omitting a queue name or specifying -l/--list will show you the registered
    queues - by default the "normal" patches queue is registered. The
    currently active queue will be marked with "(active)".

    To create a new queue, use -c/--create. The queue is automatically made
    active, except in the case where there are applied patches from the
    currently active queue in the repository. Then the queue will only be
    created and switching will fail.

    To delete an existing queue, use --delete. You cannot delete the currently
    active queue.

    Returns 0 on success.

options:

 -l --list    list all available queues
 -c --create  create new queue
    --rename  rename active queue
    --delete  delete reference to queue
    --purge   delete queue, and remove patch dir

You can't have the stuff in .hg be sub-repos of the external (outer/parent) repos but it should be possible to have different paths for each of the qqueue repos, and perhaps make them all subrepos of a parent repo that is itself inside .hg/patches.

like image 173
Ry4an Brase Avatar answered Sep 26 '22 08:09

Ry4an Brase