We have two major release branches – ‘stable’ and ‘beta’. Over time, the ‘beta’ branch has received changes that didn’t progress to stable, but were never removed.
What I’d like to do is sync beta with stable again so they are exactly the same. Is this possible with mercurial while keeping the same branch names?
We have rudimentary deployment set up for beta where a receive commit on the branch pushes out to all the webservers. I could just start a new branch off stable, but that would cause confusion.
Essentially I want to do this:
hg update stable
hg branch beta --overwrite
Backout-solution
In order to exclude from result (not in history of branch) you can a) backout “stalled” changesets in beta branch b) merge stable to beta
Rebase-solution
Create additional branch, rebase unwanted changesets to this branch, merge stable to beta
MQ-solution
Install mq, convert changesets-in-question into MQ-patches, unapply all mq-pathes, merge stable to beta
Addition
If unwanted changesets in beta are unknown
(Ry4an graph used as source for commands)
Diff-patch way
Idea: adding “correcting changeset” on top of beta, which bring bring beta to a the state, identical to state of branch stable@6
Implementation:
hg up beta & hg diff -r beta -r stable | hg import - & hg commit -m "Beta synced"New branch way
Idea: forgot about old outdated branch beta, create beta from scratch, current state of stable
Implementation:
hg up beta & hg commit -m "Closing branch" --close-branch & hg up stable & hg branch -F beta & ... & hg commit -m "Reopen new beta"