You are really close, and you do not need to resort to transplantation (yuck) or cherry picking in general. Disabling premerge is the first step, and then just delete the files you don't want in the main branch after merging, but before committing. You will need to do this only once.
Here's the setting:
o changeset: 3:343d531512a3 | branch: solar | tag: tip | parent: 1:cb26642f8db5 | user: Ry4an Brase < ry4an@msi.umn.edu > | date: Wed Mar 10 11:16:48 2010 -0600 | files: afile | description: | solar-change | | | @ changeset: 2:c5d14e34db07 | | parent: 0:56465175b2fc | | user: Ry4an Brase < ry4an@msi.umn.edu > | | date: Wed Mar 10 11:05:44 2010 -0600 | | files: other-main-file | | description: | | moremain | | | | o | changeset: 1:cb26642f8db5 |/ branch: solar | user: Ry4an Brase < ry4an@msi.umn.edu > | date: Wed Mar 10 11:04:32 2010 -0600 | files: solar-only | description: | solar-initial | | o changeset: 0:56465175b2fc user: Ry4an Brase < ry4an@msi.umn.edu > date: Wed Mar 10 11:04:14 2010 -0600 files: afile description: initial
You can see that set of changes 1 adds a file to the solar branch - a file that we do not want by default. While changeet 3 modifies the file, which also exists in main, afile, and we want to manually control whether this change occurs.
So hg update default ; hg merge -r solar hg update default ; hg merge -r solar . A merge tool will appear for afile , and we decided that if we want these changes, we will choose line by line or chunk-by-chunk. After saving, run hg stat :
% hg stat M afile M solar-only
And we see that only solar energy is queued for default. Just delete it (using if ).
% hg rm -f solar-only
Now hg stat shows it as remote:
% hg stat M afile R solar-only
and when we commit, we get what we want in the new set of changes.
source share