Reputation: 11863
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?
Upvotes: 3
Views: 972
Reputation: 6548
You can cherrypick changesets using the hg transplant
extension.
transplant
is 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.
Upvotes: 6