Howto transplant changes of a certain changeset only for one file?
Steve Borho
steve at borho.org
Wed Jan 13 21:38:36 CST 2010
On Wed, Jan 13, 2010 at 9:35 AM, Marko Käning <mk362 at mch.osram.de> wrote:
> I have two branches and want to merge in some changes made on one branch
> into the other.
>
> The transplant extension does in principle what I want, but would - of
> course - transplant all changes of a specific changeset.
>
> What I want to achieve is that only changes made to ONE specific file are
> carried out. So this won't be a fully transplanted changeset, rather a
> subset of its changes.
>
> How do I achieve this in a clean way with hg?
You could try TortoiseHg's undocumented cherry picker. Start the
repository explorer, aka: hgtk log
Left click to select the base changeset of the changes you would like
to transplant. Right click on the last changeset and from the popup
menu chose 'Diff with selected...'
This opens a status window with the accumulative changes between the
two selected changesets. This window can write a patch file using the
"active" contents in the dialog. This means you can uncheck files to
remove them from the final patch, and you can use the hunk selection
tab to remove individual change hunks. The 'save preview' tab
previews the patch it will write when you click 'Save as...'. After
saving the patch, you update the repository to the transplant branch
and then import the patch.
By reversing the order of the selections, you can do a cherry-picked
backout of changes in much the same way.
--
Steve Borho
More information about the Mercurial
mailing list