MQ merging

Jesse Glick jesse.glick at sun.com
Sat Mar 1 18:35:56 CST 2008


Jesse Glick wrote:
> Probably MQ should save the original base parent for the _queue_
> (i.e. `hg id -r qbase`) rather than an individual patch, because (1)
> it makes no sense to save the parent of any patch which was not at
> the top of the queue, (2) you might anyway reorder the queue before
> rebasing (in which case any problems reapplying the patches is your
> decision).

I should amend this; better to save the qbase ID for each individual 
patch whenever it is created; pushed without fuzz or rejects; or 
refreshed. You may have a "stack" of patches which are in fact quite 
unrelated and which you worked on at different times, so it makes sense 
to remember for each one when it was known to apply cleanly.

MQ could include this information in the series file, e.g.

fix-some-problem.diff      abc123325ffb37227364298731aac
another-rfe.diff           88f243ce880a7987c870987ee87d9

(permitting a patch to have no specified qbase), or to retain 
bidirectional compatibility with older versions of MQ use a different 
file for the qbase mapping, or simply insert the information in an 
optional patch header:

# Queue base: abc123325ffb37227364298731aac
Description of patch.
diff a/file b/file
....

("Parent node ID" is not an accurate description because the patch might 
apply only atop another patch. You want to record the queue base below 
all patches.)



More information about the Mercurial mailing list