Let’s say I have anonymous branches AA and BB.
In branch AA there is a changeset CC which I’d like to merge into BB, without bringing in all its parents.
Doing this would work:
hg diff -c CC >>CC.diff
patch -p1 <CC.diff
However, I’d lose the information that this the same changeset as CC, I’d just be creating a new one which happens to do the same thing.
Is there a more repository-friendly way to go?
You can cherrypick changesets using the
hg transplantextension.transplantis fine when you cannot do a full merge for some reason. However, it is not recommended to rely on it in your daily workflow due to its side effects.EDIT: This functionality is a core feature (
hg graft) in Mercurial since version 2.0.