Having the same problem, I came across this question. Now I have found a solution that I would like to share with you.
Suppose we have two devices: A and B, both have essentially the same firmware, but with certain differences that need to be saved. Thus, two versions are saved in two branches - A and B
If I make changes to one of the versions, I can combine them with others in certain conditions.
The condition is that the common predecessor (common base) must have a "giving" branch.
To ensure this, you can do
hg debugsetparents . <other branch before the modifications>
After that, the current working set is similar to merging two branches, except that the data remains stable, i.e. e. "We" retain "our" material.
After that, you can perform a "real" merge with another branch after the changes.
The result of this is that you get exactly the difference between the manually created common base in the cottage branch and the final state of the feed branch, which leads to the exact change that you want to receive.
source share