Reputation: 7216
I have a mercurial repository with two branches (default and branch1) I have a fix that I wanted to do on default but I made it in branch1. I don't want to merge from branch1 to default. Is there a way to move that fix to the default branch without moving anything else?
Upvotes: 0
Views: 61
Reputation: 4389
You can use transplant, https://www.mercurial-scm.org/wiki/GitConcepts but it requires the transplant extension.
Upvotes: 1
Reputation: 73788
If you commit a changeset on the wrong branch, then you have two options:
copy the changeset to the right branch with transplant. The change will now appear twice in your history, but standard three-way merge will deal with that just fine. I've described that scenario in my guide to named branches.
move the changeset to the right branch with something like mq. This should only be done for changesets that haven't been pushed anywhere since you're editing history.
Upvotes: 1