I committed and pushed some changes to the wrong branch. I found a way to fix it, but it seems overly complicated. Is this really the easiest way?
- on the branch that you made your changes, type
hg diff -r <parent> -r <with_changes> > patch.diff
hg up <proper_branch>
hg import --no-commit patch.diff
hg ci -m 'committing changes to proper branch'
hg up <bad_branch>
hg parentto find previous changeset on this branch that is good
hg ci --close-branch -m 'closing bad branch'
hg up <last_good_changeset>
- add a space or other minor change
hg ci -m 'making tip'
Something to that effect anyway. I did it in a slightly different order; I made the good changeset the tip again, and had to do a force commit because it creates a new head, then had to run
hg heads `hg branch`
To find the bad branch again, then close it. Now it still shows the bad changeset as the "tip" because I closed it after I "re-tipped" the good branch, but when updating to that branch, I guess it takes the most recent non-closed head?
Seems like quite a ridiculous process to fix such a simple mistake.
Is there any easier way to do this? Why not?