Switch to hg-flow model: how to rebase commits and branches
I started some time ago a small project and used mercurial as RCS.
All commits were done in the
default branch, except for one feature branch currently in development in a separate clone of the project.
The project became quite important and I’d like to switch to Driessen’s model.
I’ve been able to rebase all commits from
$ # Starting in the default branch $ hg up -r 0 $ hg branch develop $ hg ci -m 'created the develop branch' $ hg rebase --source 1
My problem is that I can’t import my
feature/new-feature branch into the
develop branch without losing the branch information.
I’m quite confident there is a adequat way to do it but I can’t find it.
Thanks in advance.
2 Solutions collect form web for “Switch to hg-flow model: how to rebase commits and branches”
Try hgflow. It’s like git-flow for Mercurial
OK so this is the workaround I came to.
Maybe there is a proper solution.
Anyway, this works.
$ # Create branch develop at rev 0. $ hg up -r 0 $ hg branch develop $ hg ci -m 'creating branch develop' $ $ # Rebase all commits into the develop branch. $ # This will merge the feature/new-feature branch into develop. $ hg rebase -s 1 $ $ # Re-create the feature/new-feature branch from its original parent. $ hg up -r 357 $ hg branch feature/new-feature $ hg ci -m 'created branch feature/new-feature' $ $ # Move commits that belong to this branch from develop from newly re-created $ # branch. $ hg rebase --base 358 --dest tip